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.
-
Describe the bug
When using
TestCase
from frompyfakefs.fake_filesystem_unittest import TestCase
callingself.setUpPyfakefs
onsetUp
, trying to create apytz
timezone
object will always result in ÙnknownTimeZoneError` no matter the timezone string.In contrast, omitting the call to
self.setUpPyfakefs
or usingTestCase
fromunittest
does not result in this error.How To Reproduce
However not setting up the fake fs (or equivalently, using
TestCase
fromunittest
) 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