Skip to content

Commit

Permalink
Revert "Try to solve problems in testing paths on Windows"
Browse files Browse the repository at this point in the history
This reverts commit a98f109.
  • Loading branch information
abravalheri committed Jan 23, 2023
1 parent d03034d commit 171aab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
6 changes: 0 additions & 6 deletions tests/log_helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import logging
import os
import re
from pathlib import Path


def find_report(log, activity, subject):
Expand Down Expand Up @@ -66,7 +64,3 @@ def ansi_pattern(text):

def ansi_regex(text):
return re.compile(ansi_pattern(text), re.I)


def normalized_path(path):
return str(Path(path)).replace(os.sep, "/")
10 changes: 2 additions & 8 deletions tests/test_log.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logging
import os
import re
from os import getcwd
from os.path import abspath

import pytest

from pyscaffold.file_system import localize_path
from pyscaffold.file_system import localize_path as lp
from pyscaffold.log import (
DEFAULT_LOGGER,
ColoredReportFormatter,
Expand All @@ -22,7 +21,6 @@
make_record,
match_record,
match_report,
normalized_path,
)

# When adding tests to this file, please have in mind that the global shared
Expand All @@ -33,10 +31,6 @@
# if really necessary.


def lp(path):
return normalized_path(localize_path(path))


@pytest.fixture
def uniq_raw_logger():
return logging.getLogger(uniqstr())
Expand Down Expand Up @@ -348,7 +342,7 @@ def test_colored_report(tmpfolder, caplog, uniq_raw_logger):
out = caplog.messages[-1]
assert re.search(ansi_pattern("make") + ".+" + name, out)
# And relative paths should be used
assert lp("/tmp") not in out.replace(os.sep, "/")
assert lp("/tmp") not in out


def test_colored_others_methods(caplog, uniq_raw_logger):
Expand Down

0 comments on commit 171aab2

Please sign in to comment.