I need help with prefect test harness. I am runnin...
# ask-community
j
I need help with prefect test harness. I am running the hello world test from the docs
Copy code
from prefect import flow
from prefect.testing.utilities import prefect_test_harness

@flow
def my_favorite_flow():
    return 42

def test_my_favorite_flow():
  with prefect_test_harness():
      # run the flow against a temporary testing database
      assert my_favorite_flow() == 42
But... I'm in a virtual environment for my actual job, and my prefect profile includes this setting PREFECT_LOGGING_EXTRA_LOGGERS='jds' so I assume this is where the value of v in the stack trace below is coming from.
👀 1
n
hrm what version are you on?
Copy code
» PREFECT_LOGGING_EXTRA_LOGGERS='jds' ipython
In [1]: from prefect.settings import Settings

In [2]: Settings().logging.extra_loggers
Out[2]: ['jds']

In [3]: !uv pip list | rg prefect
prefect                    3.0.12.dev2+3.g9f2f47572d /Users/nate/github.com/prefecthq/prefect
out of curiosity, if you did
Copy code
» pip install git+<https://github.com/prefecthq/prefect.git>
and try again, does it work?
j
Currently on 3.0.11
(Nox is rebuilding my virtual env each time so I should be grabbing the latest)
n
sorry, i meant to suggest it might work on
main
if not in the most recent version on PyPI but im thinking now it might have to do with
temporary_settings
(used by test harness)
j
There is barely any documentation on using the test harness facility. Should I read the source for how to change settings in the test harness?
j
Hi Janet. That’s probably the best option, and agree more docs could be helpful there. Want to open an issue to track in the GH repo?
j
@Jeff Hale Logged #15890
👍 1
🙏 1