Skip to content

Commit

Permalink
no way to robustly set Windows files to readonly, so removed those tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trislee committed Sep 21, 2023
1 parent 89d8952 commit c7f2db1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 29 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ jobs:
python-version: '3.9'
- run: pip install -e .[dev]
- run: python -m playwright install
- run: pytest --exitfirst --failed-first
- run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
pytest
2 changes: 1 addition & 1 deletion .github/workflows/pytest_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
python-version: '3.9'
- run: pip install -e .[dev]
- run: python -m playwright install
- run: pytest --exitfirst --failed-first
- run: pytest
26 changes: 0 additions & 26 deletions tests/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,6 @@ def test_parser(hashtags, attribute, value, flag):
assert args.get("hashtags") == hashtags


def test_output_dir_spec_noexist_nowrite(tmp_path):
# Specified nonexistent output directory without write permissions
parser = create_parser()
os.chmod(tmp_path, 0o444)
specified_output_dir = tmp_path / "test"
with pytest.raises(SystemExit) as system_exit:
result = process_output_dir(
specified_output_dir=specified_output_dir, parser=parser
)
assert system_exit.type == SystemExit
os.chmod(tmp_path, 0o666)


def test_output_dir_spec_exist_nowrite(tmp_path):
# Specified existing output directory without write permissions
parser = create_parser()
os.chmod(tmp_path, 0o444)
specified_output_dir = tmp_path
with pytest.raises(SystemExit) as system_exit:
result = process_output_dir(
specified_output_dir=specified_output_dir, parser=parser
)
assert system_exit.type == SystemExit
os.chmod(tmp_path, 0o666)


def test_output_dir_unspec_nowrite(monkeypatch, tmp_path):
# Unspecified, in current directory without write permissions
parser = create_parser()
Expand Down
2 changes: 1 addition & 1 deletion tiktok_hashtag_analysis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_hashtag_posts(self, hashtag: str, limit: int, headed: bool):
)
except Exception as e:
logger.warning(
"Encountered error {e} when fetching data, retrying in headed mode"
f"Encountered error {e} when fetching data, retrying in headed mode"
)
fetched_data = asyncio.run(
_fetch_hashtag_data(hashtag=hashtag, limit=limit, headed=True)
Expand Down

0 comments on commit c7f2db1

Please sign in to comment.