Skip to content

Commit

Permalink
Updated another testing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
smartycope committed Apr 17, 2024
1 parent 2768f83 commit 69f49e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --upgrade pytest jstyleson py_js_runner rich
python -m pip install --upgrade pytest jstyleson py_js_runner rich Cope
- name: Run Tests
run: |
pytest .
10 changes: 1 addition & 9 deletions ezregex/EZRegex.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,22 +386,14 @@ def test(self, testString=None, show=True, context=True) -> bool:
if not show:
return bool(len(json['matches']))

_cope = False
if context:
# Use the nice context function in the Cope library
try: from Cope import get_context, get_metadata
except ImportError: pass
else: _cope = True

st = Text() # String
gt = Text() # Groups (all the group-related text)
defaultColor = 'bold'
textColor = ''

st.append("Testing expression", style=defaultColor)
# Add the context line
if _cope:
st.append(f' (from {get_context(get_metadata(2), False, True, True).strip()})', style=defaultColor)
# st.append(f' (from {get_context(get_metadata(2), False, True, True).strip()})', style=defaultColor)
st.append(':\n', style=defaultColor)

# The expression we're testing
Expand Down

0 comments on commit 69f49e2

Please sign in to comment.