Unittests cannot be used as points of entry

Bug #275059 reported by Michal Kwiatkowski on 2008-09-27
2
Affects Status Importance Assigned to Milestone
Pythoscope
Medium
Michal Kwiatkowski

Bug Description

Point of entry defined as:

    import unittest
    import foo

    class FooTest(unittest.TestCase):
        def test_foo(self):
            assert 42 == foo.foo()

    unittest.main()

for code defined in foo.py as:

    def foo():
         return 42

will raise an exception:

    Warning: Point of entry exited with error: AttributeError("'module' object has no attribute 'foo'",)

Somehow Pythoscope doesn't work well with unittest.main().

Related branches

Changed in pythoscope:
importance: Undecided → Medium
status: New → Confirmed
Changed in pythoscope:
milestone: none → 0.4.1-setup-and-teardown-fixes
Changed in pythoscope:
assignee: nobody → ruby
Michal Kwiatkowski (ruby) wrote :

Fix would require running points of entry inside separate modules, but there is a viable workaround, committed in trunk r258.

Changed in pythoscope:
status: Confirmed → Fix Committed
Michal Kwiatkowski (ruby) wrote :

Fix released in 0.4.1.

Changed in pythoscope:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers