def test_tmpdir_fallback_tox_env(testdir, monkeypatch):
 monkeypatch.delenv('USER', raising=False)
 monkeypatch.delenv('USERNAME', raising=False)
 testdir.makepyfile('\n        import pytest\n        def test_some(tmpdir):\n            assert tmpdir.isdir()\n    ')
 reprec = testdir.inline_run()
 reprec.assertoutcome(passed=1)

def test_tmpdir_fallback_tox_env ( testdir , monkeypatch ) : monkeypatch . delenv ( 'USER' , raising = False ) monkeypatch . delenv ( 'USERNAME' , raising = False ) testdir . makepyfile ( '\n        import pytest\n        def test_some(tmpdir):\n            assert tmpdir.isdir()\n    ' ) reprec = testdir . inline_run ( ) reprec . assertoutcome ( passed = 1 )
test that tmpdir works even if environment variables required by getpass module are missing .