[rhinstaller/blivet/pulls/133 master] Fix tests deprecation warnings in a backward compatible way

atodorov installerbot-noreply at redhat.com
Wed May 27 11:40:22 UTC 2015


Fixed the assertRaises calls to use context manager.

The only thing left is modifying the class hierarchy to deal with the versioning problem. Btw I've updated fslabeling.py to the new syntax and LoopBackedTestCase to inherit from BlivetTestCase but for some reason I'm still getting these two errors
```
======================================================================
ERROR: testLabeling (formats_test.labeling_test.Ext2FSTestCase)
A sequence of tests of filesystem labeling.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/www/html/blivet/tests/formats_test/fslabeling.py", line 139, in testLabeling
    with self.assertRaisesRegex(FSError, "default label"):
AttributeError: 'Ext2FSTestCase' object has no attribute 'assertRaisesRegex'

======================================================================
ERROR: testLabeling (formats_test.labeling_test.FATFSTestCase)
A sequence of tests of filesystem labeling.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/www/html/blivet/tests/formats_test/fslabeling.py", line 139, in testLabeling
    with self.assertRaisesRegex(FSError, "default label"):
AttributeError: 'FATFSTestCase' object has no attribute 'assertRaisesRegex'
```

I can't figure out why this happens, all other classes which were modified to inherit from BlivetTestCase seem to work pretty well.
-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/133


More information about the anaconda-patches mailing list