mik-laj commented on a change in pull request #16954:
URL: https://github.com/apache/airflow/pull/16954#discussion_r668706982
##########
File path: tests/operators/test_python.py
##########
@@ -817,6 +822,31 @@ def f():
self._run_as_operator(f, requirements=['funcsigs', 'dill'],
system_site_packages=False)
+ def test_private_repo_requirements(self):
+
+ with create_session() as session:
+ self._clean_stop_pypi_server()
+ self._initiate_pypi_server()
+ session.execute("delete from connection where conn_id =
'private_repo_test_conn';")
+ cn = Connection("private_repo_test_conn",
+ "private_pypi",
+ host="localhost",
+ schema="http",
+ port=8080)
+ session.add(cn)
+
+ def f():
+ import flask # noqa: F401
+ import funcsigs # noqa: F401
+ self._run_as_operator(
+ f,
+ requirements=['flask', 'funcsigs'],
+ connection_id="private_repo_test_conn",
+ system_site_packages=False,
+ )
+ session.commit()
+ self._clean_stop_pypi_server()
Review comment:
When an exception is thrown this server is not stopped and will still be
able to create unexpected side effects. Whay do you think about fixtures?
See: [Teardown/Cleanup (AKA Fixture
finalization)](https://docs.pytest.org/en/6.2.x/fixture.html#teardown-cleanup-aka-fixture-finalization)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]