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

Method test_global

Lib/test/test_fstring.py:1257–1269  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1255 self.assertEqual(f'{3!s:}', '3')
1256
1257 def test_global(self):
1258 self.assertEqual(f'g:{a_global}', 'g:global variable')
1259 self.assertEqual(f'g:{a_global!r}', "g:'global variable'")
1260
1261 a_local = 'local variable'
1262 self.assertEqual(f'g:{a_global} l:{a_local}',
1263 'g:global variable l:local variable')
1264 self.assertEqual(f'g:{a_global!r}',
1265 "g:'global variable'")
1266 self.assertEqual(f'g:{a_global} l:{a_local!r}',
1267 "g:global variable l:'local variable'")
1268
1269 self.assertIn("module 'unittest' from", f'{unittest}')
1270
1271 def test_shadowed_global(self):
1272 a_global = 'really a local'

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.95
assertInMethod · 0.95

Tested by

no test coverage detected