Replies: 2 comments 1 reply
-
|
The problem here is that from pathlib import Path
import pytz
class ExampleTestCase(TestCase):
def setUp(self):
self.setUpPyfakefs()
info_dir = Path(pytz.__file__).parent / "zoneinfo"
self.fs.add_real_directory(info_dir)See also this entry in the troubleshooting section of the documentation. It probably would make sense to add this concrete example there. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @mrbean-bremen ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When using
TestCasefrom frompyfakefs.fake_filesystem_unittest import TestCasecallingself.setUpPyfakefsonsetUp, trying to create apytztimezoneobject will always result in ÙnknownTimeZoneError` no matter the timezone string.In contrast, omitting the call to
self.setUpPyfakefsor usingTestCasefromunittestdoes not result in this error.How To Reproduce
However not setting up the fake fs (or equivalently, using
TestCasefromunittest) does not yield this errorYour environment
I'd be interested in helping out on a solution to this if required!
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions