MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sys_flags

Method test_sys_flags

Lib/test/test_sys.py:853–868  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

851 self.assertTrue(sys._is_interned(s))
852
853 def test_sys_flags(self):
854 self.assertTrue(sys.flags)
855 attrs = ("debug",
856 "inspect", "interactive", "optimize",
857 "dont_write_bytecode", "no_user_site", "no_site",
858 "ignore_environment", "verbose", "bytes_warning", "quiet",
859 "hash_randomization", "isolated", "dev_mode", "utf8_mode",
860 "warn_default_encoding", "safe_path", "int_max_str_digits")
861 for attr in attrs:
862 self.assertHasAttr(sys.flags, attr)
863 attr_type = bool if attr in ("dev_mode", "safe_path") else int
864 self.assertEqual(type(getattr(sys.flags, attr)), attr_type, attr)
865 self.assertTrue(repr(sys.flags))
866 self.assertEqual(len(sys.flags), len(attrs))
867
868 self.assertIn(sys.flags.utf8_mode, {0, 1, 2})
869
870 def assert_raise_on_new_sys_type(self, sys_attr):
871 # Users are intentionally prevented from creating new instances of

Callers

nothing calls this directly

Calls 7

getattrFunction · 0.85
reprFunction · 0.85
lenFunction · 0.85
assertTrueMethod · 0.80
assertInMethod · 0.80
assertHasAttrMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected