Skip to content

Commit

Permalink
Try not to assume a module's file extension is .py
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed Apr 19, 2017
1 parent 581b463 commit 3c3c6fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Justyna Janczyszyn
Kale Kundert
Katarzyna Jachim
Kevin Cox
Kodi B. Arfer
Lee Kamentsky
Lev Maximov
Loic Esteve
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* Added documentation related to issue (`#1937`_)
Thanks `@skylarjhdownes`_ for the PR.

* In ``python.PyobjMixin.getmodpath``, don't assume the module's file extension
is ".py" (`#2369`_).
Thanks `@Kodiologist`_ for the PR.

*

*
Expand All @@ -23,11 +27,13 @@
.. _@skylarjhdownes: https://github.com/skylarjhdownes
.. _@fabioz: https://github.com/fabioz
.. _@metasyn: https://github.com/metasyn
.. _@Kodiologist: https://github.com/Kodiologist


.. _#1937: https://github.com/pytest-dev/pytest/issues/1937
.. _#2276: https://github.com/pytest-dev/pytest/issues/2276
.. _#2336: https://github.com/pytest-dev/pytest/issues/2336
.. _#2369: https://github.com/pytest-dev/pytest/issues/2369


3.0.7 (2017-03-14)
Expand Down
4 changes: 2 additions & 2 deletions _pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import fnmatch
import inspect
import sys
import os
import collections
import math
from itertools import count
Expand Down Expand Up @@ -235,8 +236,7 @@ def getmodpath(self, stopatmodule=True, includemodule=False):
continue
name = node.name
if isinstance(node, Module):
assert name.endswith(".py")
name = name[:-3]
name = os.path.splitext(name)[0]
if stopatmodule:
if includemodule:
parts.append(name)
Expand Down

0 comments on commit 3c3c6fd

Please sign in to comment.