diff --git a/checkpy/lib/declarative.py b/checkpy/lib/declarative.py index d4892e1..c2ddee0 100644 --- a/checkpy/lib/declarative.py +++ b/checkpy/lib/declarative.py @@ -163,6 +163,7 @@ def stdoutRegex(self, regex: Union[str, re.Pattern], readable: Optional[str]=Non """ Assert that the last call printed output matching regex. If readable is passed, show that instead of the regex in the test's output. + Uses built-in re.search underneath the hood to find the first match. """ def testStdoutRegex(state: FunctionState): nonlocal regex @@ -176,7 +177,7 @@ def testStdoutRegex(state: FunctionState): actual = state.function.printOutput - match = regex.match(actual) + match = regex.search(actual) if not match: if readable: raise AssertionError(f"The printed output does not match the expected output. This is expected:\n" diff --git a/checkpy/lib/static.py b/checkpy/lib/static.py index f6758ce..08b303c 100644 --- a/checkpy/lib/static.py +++ b/checkpy/lib/static.py @@ -29,7 +29,7 @@ def getSource(fileName: _Optional[_Union[str, _Path]]=None) -> str: if fileName is None: if _checkpy.file is None: raise _exception.CheckpyError( - message=f"Cannot call getSource() without passing fileName as argument if not test is running." + message=f"Cannot call getSource() without passing fileName as argument if no test is running." ) fileName = _checkpy.file.name diff --git a/setup.py b/setup.py index 246cea9..ff9916a 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='checkPy', - version='2.0.12', + version='2.0.13', description='A simple python testing framework for educational purposes', long_description=long_description,