Skip to content

Regression in >= 3.5.3 when running in python 2.7 #469

Closed
@rasjani

Description

@rasjani

builtin data types (and propably something else too) removed (?) after a call to setupPyFakefs() in and after 3.5.3 release with python 2.7.

Run following

from unittest import main as run_tests
import sys

class TestSuites(TestCase):
    def setUp(self):
        self.setUpPyfakefs()
    def test_foo(self):
        real_foo = False

if __name__ == '__main__':
        run_tests(failfast=False, buffer=False, catchbreak=False)

throws following error:

E
======================================================================
ERROR: test_foo (__main__.TestSuites)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_acceptance.py", line 9, in test_foo
NameError: global name 'False' is not defined

----------------------------------------------------------------------
Ran 1 test in 0.009s

FAILED (errors=1)

Same issue doesn't seem to effect python3 with same library version.

Darwin-18.0.0-x86_64-i386-64bit
('Python', '2.7.15 (default, Nov 27 2018, 21:40:55) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]')
('pyfakefs', '3.5.3')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions