summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-03-18 00:00:52 (GMT)
committerGitHub <noreply@github.com>2022-03-18 00:00:52 (GMT)
commit0b5f99ad1af0892a2d6043abd8aeb10d685d3844 (patch)
tree744f62e67d671917cc7b2d3461c8d74fd752c332 /Lib/unittest
parentba76f901923d80ad9b24bb1636aa751d55e0c768 (diff)
downloadcpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.zip
cpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.tar.gz
cpython-0b5f99ad1af0892a2d6043abd8aeb10d685d3844.tar.bz2
bpo-46421: Fix unittest filename evaluation when called as a module (GH-30654)
(cherry picked from commit a0db11b10fca0fee6bb2b8d6277e266bad8c0fdb) Co-authored-by: Bader Zaidan <bader@zaidan.pw>
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index e62469a..88a188c 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -39,7 +39,7 @@ def _convert_name(name):
name = rel_path
# on Windows both '\' and '/' are used as path
# separators. Better to replace both than rely on os.path.sep
- return name[:-3].replace('\\', '.').replace('/', '.')
+ return os.path.normpath(name)[:-3].replace('\\', '.').replace('/', '.')
return name
def _convert_names(names):