[FIX] various: --test-file on Windows

closes odoo/odoo#75341

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
John Wilson
2021-09-14 06:00:52 +00:00
parent 15d5769d95
commit 63c00f700d
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1220,7 +1220,7 @@ def load_test_file_py(registry, test_file):
threading.currentThread().testing = True
try:
test_path, _ = os.path.splitext(os.path.abspath(test_file))
for mod in [m for m in get_modules() if '/%s/' % m in test_file]:
for mod in [m for m in get_modules() if '%s%s%s' % (os.path.sep, m, os.path.sep) in test_file]:
for mod_mod in loader.get_test_modules(mod):
mod_path, _ = os.path.splitext(getattr(mod_mod, '__file__', ''))
if test_path == config._normalize(mod_path):
+2 -2
View File
@@ -10,7 +10,7 @@ import sys
import tempfile
import warnings
import odoo
from os.path import expandvars, expanduser, abspath, realpath
from os.path import expandvars, expanduser, abspath, realpath, normcase
from .. import release, conf, loglevels
from . import appdirs
@@ -737,7 +737,7 @@ class configmanager(object):
def _normalize(self, path):
if not path:
return ''
return realpath(abspath(expanduser(expandvars(path.strip()))))
return normcase(realpath(abspath(expanduser(expandvars(path.strip())))))
config = configmanager()