dannikay commented on issue #15536:
URL: https://github.com/apache/airflow/issues/15536#issuecomment-1418533074

   I tried to follow 
https://github.com/apache/airflow/blob/main/TESTING.rst#writing-unit-tests to 
run unit test locally.  The command I have is "pytest 
tests\providers\apache\beam\operators\test_beam.py". I use Windows + VS code + 
venv.
   
   But it keeps telling me that I missed messages and then I have to "pip 
install ..." each one after seeing them. The current error is:
   
   ```
   
==========================================================================================================================
 test session starts 
==========================================================================================================================
   platform win32 -- Python 3.9.1, pytest-7.2.1, pluggy-1.0.0 -- 
c:\users\lusis\vscodeprojects\dannikay_airflow\airflow\.venv\scripts\python.exe
   cachedir: .pytest_cache
   rootdir: C:\Users\lusis\VSCodeProjects\dannikay_airflow\airflow, configfile: 
pytest.ini
   plugins: anyio-3.6.2, time-machine-2.9.0
   collected 0 items / 1 error
   
   
================================================================================================================================
 ERRORS 
=================================================================================================================================
   
__________________________________________________________________________________________________
 ERROR collecting tests/providers/apache/beam/operators/test_beam.py 
__________________________________________________________________________________________________
 
   ImportError while importing test module 
'C:\Users\lusis\VSCodeProjects\dannikay_airflow\airflow\tests\providers\apache\beam\operators\test_beam.py'.
   Hint: make sure your test modules/packages have valid Python names.
   Traceback:
   .venv\lib\site-packages\_pytest\python.py:618: in _importtestmodule
       mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
   .venv\lib\site-packages\_pytest\pathlib.py:533: in import_path
       importlib.import_module(module_name)
   
..\..\..\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py:127: 
in import_module
       return _bootstrap._gcd_import(name[level:], package, level)
   <frozen importlib._bootstrap>:1030: in _gcd_import
       ???
   <frozen importlib._bootstrap>:1007: in _find_and_load
       ???
   <frozen importlib._bootstrap>:986: in _find_and_load_unlocked
       ???
   <frozen importlib._bootstrap>:680: in _load_unlocked
       ???
   .venv\lib\site-packages\_pytest\assertion\rewrite.py:168: in exec_module
       exec(co, module.__dict__)
   tests\providers\apache\beam\operators\test_beam.py:25: in <module>
       from airflow.providers.apache.beam.operators.beam import (
   airflow\providers\apache\beam\operators\beam.py:35: in <module>
       from airflow.providers.google.cloud.hooks.dataflow import (
   airflow\providers\google\cloud\hooks\dataflow.py:37: in <module>
       from airflow.providers.google.common.hooks.base_google import (
   airflow\providers\google\common\hooks\base_google.py:51: in <module>
       from airflow.providers.google.cloud.utils.credentials_provider import (
   airflow\providers\google\cloud\utils\credentials_provider.py:38: in <module>
       from 
airflow.providers.google.cloud._internal_client.secret_manager_client import 
_SecretManagerClient
   airflow\providers\google\cloud\_internal_client\secret_manager_client.py:23: 
in <module>
       from google.cloud.secretmanager_v1 import SecretManagerServiceClient
   E   ModuleNotFoundError: No module named 'google.cloud.secretmanager_v1'
   
----------------------------------------------------------------------------------------------------------------------------
 Captured stderr 
----------------------------------------------------------------------------------------------------------------------------
 
   WARNING:root:OSError while attempting to symlink the latest log directory
   
C:\Users\lusis\VSCodeProjects\dannikay_airflow\airflow\airflow\models\base.py:49
 MovedIn20Warning: Deprecated API features detected! These feature(s) are not 
compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to 
updating applications, ensure requirements files are pinned to 
"sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all 
deprecation warnings.  Set environment variable 
SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on 
SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
   
c:\users\lusis\vscodeprojects\dannikay_airflow\airflow\.venv\lib\site-packages\dill\dill.py:87
 DeprecationWarning: the imp module is deprecated in favour of importlib; see 
the module's documentation for alternative uses
   
===========================================================================================================================
 warnings summary 
============================================================================================================================
 
   .venv\lib\site-packages\_pytest\config\__init__.py:1294
     
c:\users\lusis\vscodeprojects\dannikay_airflow\airflow\.venv\lib\site-packages\_pytest\config\__init__.py:1294:
 PytestConfigWarning: Unknown config option: asyncio_mode
   
       self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
   
   -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
   
========================================================================================================================
 short test summary info 
========================================================================================================================
 
   ERROR tests/providers/apache/beam/operators/test_beam.py
   
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 Interrupted: 1 error during collection 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
   
======================================================================================================================
 1 warning, 1 error in 1.18s 
======================================================================================================================
 
   ```
   
   Am I missing anything obvious?


-- 
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]

Reply via email to