Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 removed a number of TestCase method aliases which breaks the tests #568

Open
hrnciar opened this issue Mar 24, 2023 · 0 comments

Comments

@hrnciar
Copy link

hrnciar commented Mar 24, 2023

I've a PR ready that will fix this issue, I am opening this so I can link it in the Changelog.

From Python 3.12 what's new

Removed many old deprecated unittest features:

  • A number of TestCase method aliases:

    Deprecated alias Method Name Deprecated in
    failUnless assertTrue() 3.1
    failIf assertFalse() 3.1
    failUnlessEqual assertEqual() 3.1
    failIfEqual assertNotEqual() 3.1
    failUnlessAlmostEqual assertAlmostEqual() 3.1
    failIfAlmostEqual assertNotAlmostEqual() 3.1
    failUnlessRaises assertRaises() 3.1
    assert_ assertTrue() 3.2
    assertEquals assertEqual() 3.2
    assertNotEquals assertNotEqual() 3.2
    assertAlmostEquals assertAlmostEqual() 3.2
    assertNotAlmostEquals assertNotAlmostEqual() 3.2
    assertRegexpMatches assertRegex() 3.2
    assertRaisesRegexp assertRaisesRegex() 3.2
    assertNotRegexpMatches assertNotRegex() 3.5

    Traceback

    __________________________ TestWriteZipFS.test_remove __________________________
    
    self = <tests.test_zipfs.TestWriteZipFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteZipFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ___________________________ TestMountFS.test_remove ____________________________
    
    self = <tests.test_mountfs.TestMountFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestMountFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ___________________________ TestMountFS2.test_remove ___________________________
    
    self = <tests.test_mountfs.TestMountFS2 testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestMountFS2' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _____________________________ TestOSFS.test_remove _____________________________
    
    self = <tests.test_osfs.TestOSFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestOSFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ____________________________ TestSubFS.test_remove _____________________________
    
    self = <tests.test_subfs.TestSubFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestSubFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _____________________________ TestOSFS.test_remove _____________________________
    
    self = <tests.test_osfs.TestOSFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestOSFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ___________________________ TestMultiFS.test_remove ____________________________
    
    self = <tests.test_multifs.TestMultiFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestMultiFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ______________________ TestWriteGZippedTarFS.test_remove _______________________
    
    self = <tests.test_tarfs.TestWriteGZippedTarFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteGZippedTarFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    __________________________ TestWriteTarFS.test_remove __________________________
    
    self = <tests.test_tarfs.TestWriteTarFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteTarFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ______________________ TestWriteXZippedTarFS.test_remove _______________________
    
    self = <tests.test_tarfs.TestWriteXZippedTarFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteXZippedTarFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _____________________ TestWriteTarFSToFileobj.test_remove ______________________
    
    self = <tests.test_tarfs.TestWriteTarFSToFileobj testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteTarFSToFileobj' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ______________________ TestWriteBZippedTarFS.test_remove _______________________
    
    self = <tests.test_tarfs.TestWriteBZippedTarFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestWriteBZippedTarFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ___________________________ TestMemoryFS.test_remove ___________________________
    
    self = <tests.test_memoryfs.TestMemoryFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestMemoryFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    __________________________ TestUserLogFS.test_remove ___________________________
    
    self = <tests.test_appfs.TestUserLogFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestUserLogFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _________________________ TestUserCacheFS.test_remove __________________________
    
    self = <tests.test_appfs.TestUserCacheFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestUserCacheFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    __________________________ TestSiteDataFS.test_remove __________________________
    
    self = <tests.test_appfs.TestSiteDataFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestSiteDataFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _________________________ TestSiteConfigFS.test_remove _________________________
    
    self = <tests.test_appfs.TestSiteConfigFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestSiteConfigFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _________________________ TestUserConfigFS.test_remove _________________________
    
    self = <tests.test_appfs.TestUserConfigFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestUserConfigFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    __________________________ TestUserDataFS.test_remove __________________________
    
    self = <tests.test_appfs.TestUserDataFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestUserDataFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    _____________________________ TestOSFS.test_remove _____________________________
    
    self = <tests.test_osfs.TestOSFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestOSFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    ____________________________ TestTempFS.test_remove ____________________________
    
    self = <tests.test_tempfs.TestTempFS testMethod=test_remove>
    
        def test_remove(self):
        
            self.fs.writebytes("foo1", b"test1")
            self.fs.writebytes("foo2", b"test2")
            self.fs.writebytes("foo3", b"test3")
        
            self.assert_isfile("foo1")
            self.assert_isfile("foo2")
            self.assert_isfile("foo3")
        
            self.fs.remove("foo2")
        
            self.assert_isfile("foo1")
            self.assert_not_exists("foo2")
            self.assert_isfile("foo3")
        
            with self.assertRaises(errors.ResourceNotFound):
                self.fs.remove("bar")
        
            self.fs.makedir("dir")
            with self.assertRaises(errors.FileExpected):
                self.fs.remove("dir")
        
            self.fs.makedirs("foo/bar/baz/")
        
            error_msg = "resource 'foo/bar/egg/test.txt' not found"
    >       assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp)
    E       AttributeError: 'TestTempFS' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
    
    fs/test.py:1085: AttributeError
    =============================== warnings summary ===============================
    fs/base.py:75
    fs/base.py:75
    fs/base.py:75
    fs/base.py:75
    fs/base.py:75
      /builddir/build/BUILD/pyfilesystem2-2.4.16/fs/base.py:75: DeprecationWarning: method 'settext' has been deprecated, please rename to 'writetext'
        warnings.warn(
    
    tests/test_wrap.py::TestWrapReadOnlySyspath::test_copy_fs_if_newer
      /builddir/build/BUILD/pyfilesystem2-2.4.16/fs/copy.py:70: DeprecationWarning: copy_fs_if_newer is deprecated. Use copy_fs_if instead.
        warnings.warn(
    
    tests/test_wrap.py::TestWrapReadOnlySyspath::test_copy_file_if_newer
      /builddir/build/BUILD/pyfilesystem2-2.4.16/fs/copy.py:163: DeprecationWarning: copy_file_if_newer is deprecated. Use copy_file_if instead.
        warnings.warn(
    
    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    =========================== short test summary info ============================
    FAILED tests/test_zipfs.py::TestWriteZipFS::test_remove - AttributeError: 'Te...
    FAILED tests/test_mountfs.py::TestMountFS::test_remove - AttributeError: 'Tes...
    FAILED tests/test_mountfs.py::TestMountFS2::test_remove - AttributeError: 'Te...
    FAILED tests/test_subfs.py::TestOSFS::test_remove - AttributeError: 'TestOSFS...
    FAILED tests/test_subfs.py::TestSubFS::test_remove - AttributeError: 'TestSub...
    FAILED tests/test_osfs.py::TestOSFS::test_remove - AttributeError: 'TestOSFS'...
    FAILED tests/test_multifs.py::TestMultiFS::test_remove - AttributeError: 'Tes...
    FAILED tests/test_tarfs.py::TestWriteGZippedTarFS::test_remove - AttributeErr...
    FAILED tests/test_tarfs.py::TestWriteTarFS::test_remove - AttributeError: 'Te...
    FAILED tests/test_tarfs.py::TestWriteXZippedTarFS::test_remove - AttributeErr...
    FAILED tests/test_tarfs.py::TestWriteTarFSToFileobj::test_remove - AttributeE...
    FAILED tests/test_tarfs.py::TestWriteBZippedTarFS::test_remove - AttributeErr...
    FAILED tests/test_memoryfs.py::TestMemoryFS::test_remove - AttributeError: 'T...
    FAILED tests/test_appfs.py::TestUserLogFS::test_remove - AttributeError: 'Tes...
    FAILED tests/test_appfs.py::TestUserCacheFS::test_remove - AttributeError: 'T...
    FAILED tests/test_appfs.py::TestSiteDataFS::test_remove - AttributeError: 'Te...
    FAILED tests/test_appfs.py::TestSiteConfigFS::test_remove - AttributeError: '...
    FAILED tests/test_appfs.py::TestUserConfigFS::test_remove - AttributeError: '...
    FAILED tests/test_appfs.py::TestUserDataFS::test_remove - AttributeError: 'Te...
    FAILED tests/test_tempfs.py::TestOSFS::test_remove - AttributeError: 'TestOSF...
    FAILED tests/test_tempfs.py::TestTempFS::test_remove - AttributeError: 'TestT...
    =========== 23 failed, 2122 passed, 23 skipped, 7 warnings in 22.31s ===========
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant