allow a path to explicity given for py.lookup

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson
2009-09-22 21:04:25 -05:00
parent 6ddea4a1bc
commit 8af3ede092
2 changed files with 21 additions and 7 deletions

View File

@@ -15,4 +15,14 @@ class TestPyLookup:
result.stdout.fnmatch_lines(
['*%s:*' %(p.basename)]
)
def test_with_explicit_path(self, testxbdir):
sub1 = testdir.mkdir("things")
sub2 = testdir.mkdir("foo")
sub1.join("pyfile.py").write("def stuff(): pass")
searched = sub2.join("other.py")
searched.write("stuff = x")
result = testdir.runpybin("py.lookup", sub2.basename, "stuff")
result.stdout.fnmatch_lines(
["%s:1: stuff = x" % (searched.basename,)]
)