Skip to content

Commit

Permalink
Fix all tests on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Vasily Litvinov <[email protected]>
  • Loading branch information
vnlitvinov committed Nov 24, 2020
1 parent 2c98c56 commit 6bba290
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ source:
- patches/0001-Switch-to-blessed.patch
- patches/0002-Do-not-use-signal-on-Windows.patch
- patches/0003-Use-default-value-for-time-formatting-on-Windows.patch
- patches/0004-Replace-CRLF-with-LF.patch

build:
noarch: python
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0001-Switch-to-blessed.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8265e2bfb4f22d370ac9d65dde08318dc2081bbc Mon Sep 17 00:00:00 2001
From: Vasily Litvinov <[email protected]>
Date: Tue, 24 Nov 2020 16:24:42 +0300
Subject: [PATCH 1/3] Switch to blessed
Subject: [PATCH 1/4] Switch to blessed

Signed-off-by: Litvinov <[email protected]>
---
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0002-Do-not-use-signal-on-Windows.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 328216a1558c0ffd0fb9b2d13b9469946a566286 Mon Sep 17 00:00:00 2001
From: Vasily Litvinov <[email protected]>
Date: Tue, 24 Nov 2020 16:36:23 +0300
Subject: [PATCH 2/3] Do not use signal on Windows
Subject: [PATCH 2/4] Do not use signal on Windows

Signed-off-by: Vasily Litvinov <[email protected]>
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a1d8dde8849cd9bfd089fd667fe9e20e9122f9e8 Mon Sep 17 00:00:00 2001
From: Vasily Litvinov <[email protected]>
Date: Tue, 24 Nov 2020 16:48:07 +0300
Subject: [PATCH 3/3] Use default value for time formatting on Windows
Subject: [PATCH 3/4] Use default value for time formatting on Windows

Signed-off-by: Vasily Litvinov <[email protected]>
---
Expand Down
26 changes: 26 additions & 0 deletions recipe/patches/0004-Replace-CRLF-with-LF.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 8ebc2fb1977eccc188c86d9582e1212f7bbe29c0 Mon Sep 17 00:00:00 2001
From: Vasily Litvinov <[email protected]>
Date: Tue, 24 Nov 2020 17:01:34 +0300
Subject: [PATCH 4/4] Replace CRLF with LF

Signed-off-by: Vasily Litvinov <[email protected]>
---
gpustat/test_gpustat.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gpustat/test_gpustat.py b/gpustat/test_gpustat.py
index 35244e3..8ef9bd2 100644
--- a/gpustat/test_gpustat.py
+++ b/gpustat/test_gpustat.py
@@ -173,7 +173,7 @@ def remove_ansi_codes(s):
import re
s = re.compile(r'\x1b[^m]*m').sub('', s)
s = re.compile(r'\x0f').sub('', s)
- return s
+ return s.replace('\r\n', '\n')


class TestGPUStat(unittest.TestCase):
--
2.29.2.windows.2

0 comments on commit 6bba290

Please sign in to comment.