Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for explicit relative imports

  • Loading branch information...
commit 4480456c04fbc2494fe02196b2b71518330dbc72 1 parent d40380d
@mwilliamson authored
View
3  test_scripts/explicit_relative_import/greetings/__init__.py
@@ -0,0 +1,3 @@
+from .greeting import message
+
+__all__ = ["message"]
View
1  test_scripts/explicit_relative_import/greetings/greeting.py
@@ -0,0 +1 @@
+message = "Hello"
View
5 test_scripts/explicit_relative_import/hello
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+
+import greetings
+
+print greetings.message
View
7 tests/stickytape_test.py
@@ -101,6 +101,13 @@ def explicit_relative_imports_with_single_dot_are_resolved_correctly():
expected_output="Hello\n"
)
+@istest
+def explicit_relative_imports_are_resolved_correctly():
+ test_script_output(
+ script_path="explicit_relative_import/hello",
+ expected_output="Hello\n"
+ )
+
def test_script_output(script_path, expected_output):
result = stickytape.script(find_script(script_path))
with _temporary_script(result) as script_file_path:
Please sign in to comment.
Something went wrong with that request. Please try again.