[FIX] various: --test-file on Windows
closes odoo/odoo#75341 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user