Skip to content

Commit 7c6d1c9

Browse files
committed
remove os.sep as it behaves differently linux and windows.
* on linux it is '/' * on windows it is '\'
1 parent 1a9bc14 commit 7c6d1c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_pytest/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,8 @@ def _mark_plugins_for_rewrite(self, hook):
10421042
)
10431043

10441044
for fn in package_files:
1045-
is_simple_module = os.sep not in fn and fn.endswith('.py')
1046-
is_package = fn.count(os.sep) == 1 and fn.endswith('__init__.py')
1045+
is_simple_module = '/' not in fn and fn.endswith('.py')
1046+
is_package = fn.count('/') == 1 and fn.endswith('__init__.py')
10471047
if is_simple_module:
10481048
module_name, ext = os.path.splitext(fn)
10491049
hook.mark_rewrite(module_name)
@@ -1351,7 +1351,7 @@ def determine_setup(inifile, args, warnfunc=None):
13511351
rootdir, inifile, inicfg = getcfg(dirs, warnfunc=warnfunc)
13521352
if rootdir is None:
13531353
rootdir = get_common_ancestor([py.path.local(), ancestor])
1354-
is_fs_root = os.path.splitdrive(str(rootdir))[1] == os.sep
1354+
is_fs_root = os.path.splitdrive(str(rootdir))[1] == '/'
13551355
if is_fs_root:
13561356
rootdir = ancestor
13571357
return rootdir, inifile, inicfg or {}

0 commit comments

Comments
 (0)