diff --git a/test/cli/test_shell.py b/test/cli/test_shell.py
index <HASH>..<HASH> 100644
--- a/test/cli/test_shell.py
+++ b/test/cli/test_shell.py
@@ -11,13 +11,20 @@ def test_helper_module(rabbit_config):
     helper.disconnect()
 
 
-def test_basic():
+def test_basic(tmpdir):
     parser = setup_parser()
     args = parser.parse_args(['shell'])
-    with patch('nameko.cli.shell.code') as code:
-        main(args)
+
+    startup = tmpdir.join('startup.py')
+    startup.write('foo = 42')
+
+    with patch('nameko.cli.shell.os.environ') as environ:
+        environ.get.return_value = str(startup)
+        with patch('nameko.cli.shell.code') as code:
+            main(args)
 
     _, kwargs = code.interact.call_args
     local = kwargs['local']
     assert 'n' in local.keys()
+    assert local['foo'] == 42
     local['n'].disconnect()
don't rely on local pystartup