seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
5.05k stars 945 forks source link

run pytest with seleniumbase failed: "argparse.ArgumentError: argument --headless: conflicting option string: --headless" #1069

Closed matthewxuda closed 2 years ago

matthewxuda commented 2 years ago

######## issues ######################################################## $pytest Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/pytest", line 8, in sys.exit(console_main()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 185, in console_main code = main() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 143, in main config = _prepareconfig(args, plugins) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 318, in _prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in call return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall gen.send(outcome) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse config: Config = outcome.get_result() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall res = hook_impl.function(args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1003, in pytest_cmdline_parse self.parse(args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1283, in parse self._preparse(args, addopts=addopts) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1175, in _preparse self.known_args_namespace = self._parser.parse_known_args( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 146, in parse_known_args return self.parse_known_and_unknown_args(args, namespace=namespace)[0] File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 155, in parse_known_and_unknown_args optparser = self._getparser() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 122, in _getparser arggroup.add_argument(n, **a) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1386, in add_argument return self._add_action(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1590, in _add_action action = super(_ArgumentGroup, self)._add_action(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1400, in _add_action self._check_conflict(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1539, in _check_conflict conflict_handler(action, confl_optionals) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1548, in _handle_conflict_error raise ArgumentError(action, message % conflict_string) argparse.ArgumentError: argument --headless: conflicting option string: --headless

######################################################################################## ######### my pip list ####################################################################### ########################################################################################

$ pip list Package Version


akshare 1.0.87 alembic 1.7.4 allure-pytest 2.9.45 allure-python-commons 2.9.45 amqp 5.0.6 apin 1.1.3 apispec 3.3.2 appdirs 1.4.4 Appium-Python-Client 1.2.0 appnope 0.1.2 APScheduler 3.6.3 asgiref 3.2.7 assertpy 1.1 astor 0.8.1 astroid 2.4.0 async-generator 1.10 atomicwrites 1.3.0 attrs 21.2.0 Automat 20.2.0 Babel 2.9.1 backcall 0.2.0 backoff 1.11.1 backports.entry-points-selectable 1.1.0 baostock 0.8.8 bcrypt 3.2.0 beautifulsoup4 4.10.0 behave 1.2.6 billiard 3.6.4.0 bitstring 3.1.9 bleach 4.1.0 boto 2.49.0 boto3 1.12.16 botocore 1.15.16 Brotli 1.0.9 bs4 0.0.1 celery 5.1.2 certifi 2021.10.8 cffi 1.15.0 chardet 4.0.0 charset-normalizer 2.0.7 click 8.0.3 click-didyoumean 0.3.0 click-plugins 1.1.1 click-repl 0.2.0 colorama 0.4.4 commonmark 0.9.1 compare 0.2b0 ConfigArgParse 1.2.1 configparser 5.0.0 constantly 15.1.0 contextlib2 21.6.0 coreapi 2.3.3 coreschema 0.0.4 croniter 1.0.15 crypto 1.4.1 cryptography 35.0.0 cssselect 1.1.0 cycler 0.10.0 dash 2.0.0 dash-bootstrap-components 1.0.0 dash-colorscales 0.0.4 dash-core-components 2.0.0 dash-daq 0.5.0 dash-html-components 2.0.0 dash-table 5.0.0 ddt 1.3.1 decorator 5.1.0 defusedxml 0.7.1 demjson 2.2.4 diff-match-patch 20181111 distlib 0.3.3 Django 2.0.2 django-cors-headers 2.1.0 django-crispy-forms 1.7.2 django-filter 2.2.0 django-formtools 2.1 django-import-export 1.0.0 django-rest-swagger 2.1.2 django-reversion 2.0.13 django-suit 2.0a1 djangorestframework 3.7.7 dnspython 2.1.0 docutils 0.15.2 dtable 0.0.5 edict 0.51 elist 0.4.65 email-validator 1.1.3 et-xmlfile 1.0.1 execnet 1.9.0 Faker 8.11.0 fasteners 0.16.3 filelock 3.3.2 Flask 2.0.2 Flask-AppBuilder 3.3.4 Flask-Babel 2.0.0 Flask-Caching 1.10.1 Flask-Compress 1.10.1 Flask-JWT-Extended 3.25.1 Flask-Migrate 3.1.0 flask-ngrok 0.0.25 Flask-OpenID 1.3.0 Flask-Script 2.0.6 Flask-SQLAlchemy 2.5.1 func-timeout 4.3.5 future 0.18.2 fuzzywuzzy 0.18.0 gensim 3.8.1 geographiclib 1.52 geopy 2.2.0 get 2019.4.13 gevent 1.5a3 geventhttpclient-wheels 1.3.1.dev2 glob2 0.7 greenlet 0.4.15 h11 0.12.0 html5lib 1.1 htmlmin 0.1.12 humanize 3.12.0 hyperlink 19.0.0 idna 3.3 ImageHash 4.2.1 importlib-metadata 4.8.1 importlib-resources 5.3.0 incremental 17.5.0 iniconfig 1.1.1 install 1.3.4 int-date 0.1.8 ipdb 0.13.9 ipython 7.29.0 isodate 0.6.0 isort 4.3.21 itsdangerous 2.0.1 itypes 1.1.0 jdcal 1.4.1 jedi 0.18.0 jieba 0.42.1 Jinja2 3.0.2 jmespath 0.10.0 joblib 1.1.0 jsonpath 0.82 jsonschema 3.2.0 kaleido 0.2.1 kiwisolver 1.3.1 kombu 5.1.0 lazy-object-proxy 1.4.3 locustio 0.14.5 lxml 4.4.1 lz4 3.1.3 Mako 1.1.5 Markdown 3.2.1 MarkupSafe 2.0.1 marshmallow 3.14.0 marshmallow-enum 1.5.1 marshmallow-sqlalchemy 0.26.1 matplotlib 3.4.2 matplotlib-inline 0.1.3 mccabe 0.6.1 missingno 0.4.2 more-itertools 8.11.0 MouseInfo 0.1.3 msgpack 0.6.2 multimethod 1.6 Naked 0.1.31 networkx 2.6.3 nose 1.3.7 numpy 1.21.3 openapi-codec 1.3.2 openpyxl 3.0.7 osxmetadata 0.99.33 outcome 1.1.0 packaging 21.2 pandas 1.3.4 parameterized 0.8.1 paramiko 2.7.2 parse 1.19.0 parse-type 0.5.2 parsedatetime 2.6 parsel 1.5.2 parso 0.8.2 pathlib2 2.3.6 patsy 0.5.2 pdfminer.six 20211012 pexpect 4.8.0 phik 0.12.0 pickleshare 0.7.5 Pillow 8.4.0 pip 21.3.1 pipenv 2021.5.29 platformdirs 2.4.0 plotly 5.3.1 pluggy 1.0.0 poium 1.0.2 polyline 1.4.0 post 2019.4.13 ppscore 1.2.0 prison 0.2.1 prompt-toolkit 3.0.22 Protego 0.1.16 psutil 5.7.0 ptyprocess 0.7.0 public 2019.4.13 py 1.11.0 py-applescript 1.0.2 py-mini-racer 0.6.0 pyarrow 5.0.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 PyAutoGUI 0.9.53 pycparser 2.21 pydantic 1.8.2 PyDispatcher 2.0.5 PyGetWindow 0.0.9 Pygments 2.10.0 PyHamcrest 2.0.2 PyJWT 1.7.1 pylint 2.5.0 PyMsgBox 1.0.9 PyMySQL 1.0.2 PyNaCl 1.4.0 pynput 1.7.4 pyobjc 7.3 pyobjc-core 7.3 pyobjc-framework-Accounts 7.3 pyobjc-framework-AddressBook 7.3 pyobjc-framework-AdSupport 7.3 pyobjc-framework-AppleScriptKit 7.3 pyobjc-framework-AppleScriptObjC 7.3 pyobjc-framework-ApplicationServices 7.3 pyobjc-framework-Automator 7.3 pyobjc-framework-AVFoundation 7.3 pyobjc-framework-AVKit 7.3 pyobjc-framework-BusinessChat 7.3 pyobjc-framework-CalendarStore 7.3 pyobjc-framework-CFNetwork 7.3 pyobjc-framework-CloudKit 7.3 pyobjc-framework-Cocoa 7.3 pyobjc-framework-Collaboration 7.3 pyobjc-framework-ColorSync 7.3 pyobjc-framework-Contacts 7.3 pyobjc-framework-ContactsUI 7.3 pyobjc-framework-CoreAudio 7.3 pyobjc-framework-CoreAudioKit 7.3 pyobjc-framework-CoreBluetooth 7.3 pyobjc-framework-CoreData 7.3 pyobjc-framework-CoreLocation 7.3 pyobjc-framework-CoreMedia 7.3 pyobjc-framework-CoreMediaIO 7.3 pyobjc-framework-CoreMIDI 7.3 pyobjc-framework-CoreML 7.3 pyobjc-framework-CoreServices 7.3 pyobjc-framework-CoreSpotlight 7.3 pyobjc-framework-CoreText 7.3 pyobjc-framework-CoreWLAN 7.3 pyobjc-framework-CryptoTokenKit 7.3 pyobjc-framework-DictionaryServices 7.3 pyobjc-framework-DiscRecording 7.3 pyobjc-framework-DiscRecordingUI 7.3 pyobjc-framework-DiskArbitration 7.3 pyobjc-framework-DVDPlayback 7.3 pyobjc-framework-EventKit 7.3 pyobjc-framework-ExceptionHandling 7.3 pyobjc-framework-ExternalAccessory 7.3 pyobjc-framework-FinderSync 7.3 pyobjc-framework-FSEvents 7.3 pyobjc-framework-GameCenter 7.3 pyobjc-framework-GameController 7.3 pyobjc-framework-GameKit 7.3 pyobjc-framework-GameplayKit 7.3 pyobjc-framework-ImageCaptureCore 7.3 pyobjc-framework-IMServicePlugIn 7.3 pyobjc-framework-InputMethodKit 7.3 pyobjc-framework-InstallerPlugins 7.3 pyobjc-framework-InstantMessage 7.3 pyobjc-framework-Intents 7.3 pyobjc-framework-IOSurface 7.3 pyobjc-framework-iTunesLibrary 7.3 pyobjc-framework-LatentSemanticMapping 7.3 pyobjc-framework-LaunchServices 7.3 pyobjc-framework-libdispatch 7.3 pyobjc-framework-LocalAuthentication 7.3 pyobjc-framework-MapKit 7.3 pyobjc-framework-MediaAccessibility 7.3 pyobjc-framework-MediaLibrary 7.3 pyobjc-framework-MediaPlayer 7.3 pyobjc-framework-MediaToolbox 7.3 pyobjc-framework-Metal 7.3 pyobjc-framework-MetalKit 7.3 pyobjc-framework-MetalPerformanceShaders 7.3 pyobjc-framework-ModelIO 7.3 pyobjc-framework-MultipeerConnectivity 7.3 pyobjc-framework-NaturalLanguage 7.3 pyobjc-framework-NetFS 7.3 pyobjc-framework-Network 7.3 pyobjc-framework-NetworkExtension 7.3 pyobjc-framework-NotificationCenter 7.3 pyobjc-framework-OpenDirectory 7.3 pyobjc-framework-OSAKit 7.3 pyobjc-framework-Photos 7.3 pyobjc-framework-PhotosUI 7.3 pyobjc-framework-PreferencePanes 7.3 pyobjc-framework-Quartz 7.3 pyobjc-framework-SafariServices 7.3 pyobjc-framework-SceneKit 7.3 pyobjc-framework-ScreenSaver 7.3 pyobjc-framework-ScriptingBridge 7.3 pyobjc-framework-SearchKit 7.3 pyobjc-framework-Security 7.3 pyobjc-framework-SecurityFoundation 7.3 pyobjc-framework-SecurityInterface 7.3 pyobjc-framework-ServiceManagement 7.3 pyobjc-framework-Social 7.3 pyobjc-framework-SpriteKit 7.3 pyobjc-framework-StoreKit 7.3 pyobjc-framework-SyncServices 7.3 pyobjc-framework-SystemConfiguration 7.3 pyobjc-framework-UserNotifications 7.3 pyobjc-framework-VideoSubscriberAccount 7.3 pyobjc-framework-VideoToolbox 7.3 pyobjc-framework-Vision 7.3 pyobjc-framework-WebKit 7.3 pyOpenSSL 21.0.0 pyotp 2.6.0 pyparsing 2.4.6 pyperclip 1.8.2 pypinyin 0.36.0 PyQt5 5.15.6 PyQt5-Qt5 5.15.2 PyQt5-sip 12.9.0 PyQtWebEngine 5.15.5 PyQtWebEngine-Qt5 5.15.2 PyRect 0.1.4 pyrsistent 0.18.0 PyScreeze 0.1.28 pytab 1.0.4 pytesseract 0.3.8 pytest 6.2.5 pytest-bdd 4.1.0 pytest-forked 1.3.0 pytest-html 2.0.1 pytest-metadata 1.11.0 pytest-ordering 0.6 pytest-parallel 0.1.1 pytest-rerunfailures 10.2 pytest-xdist 2.4.0 python-crontab 2.2.8 python-dateutil 2.8.0 python-docx 0.8.6 python-engineio 3.11.2 python-geohash 0.8.5 python-socketio 4.4.0 python3-openid 3.2.0 pytweening 1.0.4 pytz 2017.3 PyWavelets 1.1.1 PyYAML 6.0 pyzmq 18.1.0 qtstylish 0.1.5 query-string 2019.4.13 queuelib 1.5.0 redis 2.10.6 redis-py-cluster 2.1.0 request 2019.4.13 requests 2.26.0 requests-toolbelt 0.9.1 retry 0.9.2 rich 10.13.0 rsa 4.7.2 ruamel.yaml 0.16.12 ruamel.yaml.clib 0.2.6 rubicon-objc 0.4.1 s3transfer 0.3.3 sbvirtualdisplay 1.0.0 scikit-learn 0.24.2 scipy 1.7.1 Scrapy 2.0.0 seaborn 0.11.2 seldom 2.2.4 selenium 4.0.0 seleniumbase 2.1.5 service-identity 18.1.0 setuptools 58.5.3 setuptools-scm 6.3.2 shellescape 3.8.1 simplejson 3.17.2 six 1.16.0 sklearn 0.0 smart-open 1.9.0 sniffio 1.2.0 sortedcontainers 2.4.0 soupsieve 2.3 SQLAlchemy 1.3.13 SQLAlchemy-Utils 0.37.9 sqlparse 0.3.1 squarify 0.4.3 statsmodels 0.13.0 stockstats 0.3.2 strsimpy 0.2.1 superset 0.30.1 tablib 1.1.0 tabulate 0.8.9 tangled-up-in-unicode 0.2.0 tblib 1.7.0 tenacity 8.0.1 text-unidecode 1.3 threadpoolctl 3.0.0 tlist 0.6 toml 0.10.2 tomli 1.2.2 tornado 6.1 tqdm 4.61.0 traitlets 5.1.1 trio 0.19.0 trio-websocket 0.9.2 tushare 1.2.62 Twisted 19.10.0 typing-extensions 3.10.0.2 tzlocal 2.0.0 unittest-xml-reporting 3.0.4 uritemplate 3.0.1 urllib3 1.26.7 vine 5.0.0 virtualenv 20.10.0 virtualenv-clone 0.5.7 visions 0.7.4 w3lib 1.21.0 wcwidth 0.1.9 webencodings 0.5.1 websocket-client 0.57.0 Werkzeug 2.0.2 wheel 0.37.0 wordcloud 1.8.1 wrapt 1.12.1 wsproto 1.0.0 WTForms 2.3.3 WTForms-JSON 0.3.3 xarray 0.20.0 xattr 0.9.7 xlrd 1.2.0 XlsxWriter 1.0.5 zipp 3.6.0 zope.interface 4.7.1

pytest and operating system versions pytest-6.2.5 seleniumbase 2.1.5 MacBook Air (Retina, 13-inch, 2019) 1.6 GHz Intel Core i5 8 GB 2133 MHz LPDDR3 Intel UHD Graphics 617 1536 MB

mdmintz commented 2 years ago

Hi @matthewxuda, Looks like you might have another pytest plugin installed that's using the --headless option. Are you able to identify it when running pytest -h? There are two solutions. Either uninstall the other plugin that's creating the --headless option, or install seleniumbase into it's own virtual environment to avoid the pytest argument conflicts.

matthewxuda commented 2 years ago

thank you veru much, I installed selenium base and pytest-bdd a few days ago. It can still work with pytest a few days ago, but it doesn't work today. I don't know why. It has been uninstalled and reinstalled several times, but it can't work,I just uninstall all pytest and pytest plugin, and reinstall seleniumbase, but it not only install the seleniumbase, but also install many other modules, it show me "Successfully installed more-itertools-8.11.0 prompt-toolkit-3.0.22 py-1.11.0 pytest-forked-1.3.0 pytest-html-2.0.1 pytest-metadata-1.11.0 pytest-ordering-0.6 pytest-rerunfailures-10.2 pytest-xdist-2.4.0 rich-10.13.0 seleniumbase-2.1.6 soupsieve-2.3"

and I run pytest again, i meet the same problem like before, and i down't know which plugin will create the --headless option, if i know, i will uninstall allof them, can you help me, thanks again.

mdmintz commented 2 years ago

@matthewxuda Run pytest -h. It will list all the options. Search through that to figure out what other plugin is setting --headless. It will be somewhere in that list if you're getting argument conflicts.

matthewxuda commented 2 years ago

$ pytest -h Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/bin/pytest", line 8, in sys.exit(console_main()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 185, in console_main code = main() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 143, in main config = _prepareconfig(args, plugins) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 318, in _prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in call return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall gen.send(outcome) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse config: Config = outcome.get_result() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall res = hook_impl.function(args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1003, in pytest_cmdline_parse self.parse(args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1283, in parse self._preparse(args, addopts=addopts) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1175, in _preparse self.known_args_namespace = self._parser.parse_known_args( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 146, in parse_known_args return self.parse_known_and_unknown_args(args, namespace=namespace)[0] File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 155, in parse_known_and_unknown_args optparser = self._getparser() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 122, in _getparser arggroup.add_argument(n, **a) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1386, in add_argument return self._add_action(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1590, in _add_action action = super(_ArgumentGroup, self)._add_action(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1400, in _add_action self._check_conflict(action) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1539, in _check_conflict conflict_handler(action, confl_optionals) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/argparse.py", line 1548, in _handle_conflict_error raise ArgumentError(action, message % conflict_string) argparse.ArgumentError: argument --headless: conflicting option string: --headless

matthewxuda commented 2 years ago

when i run pytest -h, it still show the error info

mdmintz commented 2 years ago

@matthewxuda Try uninstalling seleniumbase and then running pytest -h again, to see what the other conflict is.

matthewxuda commented 2 years ago

usage: pytest [options] [file_or_dir] [file_or_dir] [...]

positional arguments: file_or_dir

general: -k EXPRESSION only run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. Example: -k 'test_method or test_other' matches all test functions and classes whose name contains 'test_method' or 'test_other', while -k 'not test_method' matches those that don't contain 'test_method' in their names. -k 'not test_method and not test_other' will eliminate the matches. Additionally keywords are matched to classes and functions containing extra names in their 'extra_keywordmatches' set, as well as functions which have names assigned directly to them. The matching is case-insensitive. -m MARKEXPR only run tests matching given mark expression. For example: -m 'mark1 and not mark2'. --markers show markers (builtin, plugin and per-project ones). -x, --exitfirst exit instantly on first error or failed test. --fixtures, --funcargs show available fixtures, sorted by plugin appearance (fixtures with leading '' are only shown with '-v') --fixtures-per-test show fixtures per test --pdb start the interactive Python debugger on errors or KeyboardInterrupt. --pdbcls=modulename:classname start a custom interactive Python debugger on errors. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb --trace Immediately break when running each test. --capture=method per-test capturing method: one of fd|sys|no|tee-sys. -s shortcut for --capture=no. --runxfail report the results of xfail tests as if they were not marked --lf, --last-failed rerun only the tests that failed at the last run (or all if none failed) --ff, --failed-first run all tests, but run the last failures first. This may re-order tests and thus lead to repeated fixture setup/teardown. --nf, --new-first run tests from new files first, then the rest of the tests sorted by file mtime --cache-show=[CACHESHOW] show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). --cache-clear remove all cache contents at start of test run. --lfnf={all,none}, --last-failed-no-failures={all,none} which tests to run with no previously (known) failures. --sw, --stepwise exit on test failure and continue from last failing test next time --sw-skip, --stepwise-skip ignore the first failing test but stop on the next failing test

reporting: --durations=N show N slowest setup/test durations (N=0 for all). --durations-min=N Minimal duration in seconds for inclusion in slowest list. Default 0.005 -v, --verbose increase verbosity. --no-header disable header --no-summary disable summary -q, --quiet decrease verbosity. --verbosity=VERBOSE set verbosity. Default is 0. -r chars show extra test summary info as specified by chars: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). --disable-warnings, --disable-pytest-warnings disable warnings summary -l, --showlocals show locals in tracebacks (disabled by default). --tb=style traceback print mode (auto/long/short/line/native/no). --show-capture={no,stdout,stderr,log,all} Controls how captured stdout/stderr/log is shown on failed tests. Default is 'all'. --full-trace don't cut any tracebacks (default is to cut). --color=color color terminal output (yes/no/auto). --code-highlight={yes,no} Whether code should be highlighted (only if --color is also enabled) --pastebin=mode send failed|all info to bpaste.net pastebin service. --junit-xml=path create junit-xml style report file at given path. --junit-prefix=str prepend prefix to classnames in junit-xml output --html=path create html report file at given path. --self-contained-html create a self-contained html file containing all necessary styles, scripts, and images - this means that the report may not render or function where CSP restrictions are in place (see https://developer.mozilla.org/docs/Web/Security/CSP) --css=path append given css file content to report style file.

pytest-warnings: -W PYTHONWARNINGS, --pythonwarnings=PYTHONWARNINGS set which warnings to report, see -W option of python itself. --maxfail=num exit after first num failures or errors. --strict-config any warnings encountered while parsing the pytest section of the configuration file raise errors. --strict-markers markers not registered in the markers section of the configuration file raise errors. --strict (deprecated) alias to --strict-markers. -c file load configuration from file instead of trying to locate one of the implicit configuration files. --continue-on-collection-errors Force test execution even if collection errors occur. --rootdir=ROOTDIR Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'.

collection: --collect-only, --co only collect tests, don't execute them. --pyargs try to interpret all arguments as python packages. --ignore=path ignore path during collection (multi-allowed). --ignore-glob=path ignore path pattern during collection (multi-allowed). --deselect=nodeid_prefix deselect item (via node id prefix) during collection (multi-allowed). --confcutdir=dir only load conftest.py's relative to specified dir. --noconftest Don't load any conftest.py files. --keep-duplicates Keep duplicate tests. --collect-in-virtualenv Don't ignore tests in a local virtualenv directory --import-mode={prepend,append,importlib} prepend/append to sys.path when importing test modules and conftest files, default is to prepend. --doctest-modules run doctests in all .py modules --doctest-report={none,cdiff,ndiff,udiff,only_first_failure} choose another output format for diffs on doctest failure --doctest-glob=pat doctests file matching pattern, default: test*.txt --doctest-ignore-import-errors ignore doctest ImportErrors --doctest-continue-on-failure for a given doctest, continue to run after the first failure

test session debugging and configuration: --basetemp=dir base temporary directory for this test run.(warning: this directory is removed if it exists) -V, --version display pytest version and information about plugins.When given twice, also display information about plugins. -h, --help show help message and configuration info -p name early-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use the no: prefix, e.g. no:doctest. --trace-config trace considerations of conftest.py files. --debug store internal tracing debug information in 'pytestdebug.log'. -o OVERRIDE_INI, --override-ini=OVERRIDE_INI override ini option with "option=value" style, e.g. -o xfail_strict=True -o cache_dir=cache. --assert=MODE Control assertion debugging tools. 'plain' performs no assertion debugging. 'rewrite' (the default) rewrites assert statements in test modules on import to provide assert expression information. --setup-only only setup fixtures, do not execute tests. --setup-show show setup of fixtures while executing tests. --setup-plan show what fixtures and tests would be executed but don't execute anything.

logging: --log-level=LEVEL level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's effective level, where it is "WARNING" by default. --log-format=LOG_FORMAT log format as used by the logging module. --log-date-format=LOG_DATE_FORMAT log date format as used by the logging module. --log-cli-level=LOG_CLI_LEVEL cli logging level. --log-cli-format=LOG_CLI_FORMAT log format as used by the logging module. --log-cli-date-format=LOG_CLI_DATE_FORMAT log date format as used by the logging module. --log-file=LOG_FILE path to a file when logging will be written to. --log-file-level=LOG_FILE_LEVEL log file logging level. --log-file-format=LOG_FILE_FORMAT log format as used by the logging module. --log-file-date-format=LOG_FILE_DATE_FORMAT log date format as used by the logging module. --log-auto-indent=LOG_AUTO_INDENT Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.

re-run failing tests to eliminate flaky failures: --only-rerun=ONLY_RERUN If passed, only rerun errors matching the regex provided. Pass this flag multiple times to accumulate a list of regexes to match --reruns=RERUNS number of times to re-run failed tests. defaults to 0. --reruns-delay=RERUNS_DELAY add time (seconds) delay between reruns.

distributed and subprocess testing: -n numprocesses, --numprocesses=numprocesses Shortcut for '--dist=load --tx=NUM*popen'. With 'auto', attempt to detect physical CPU count. With 'logical', detect logical CPU count. If physical CPU count cannot be found, falls back to logical count. This will be 0 when used with --pdb. --maxprocesses=maxprocesses limit the maximum number of workers to process the tests when using --numprocesses=auto --max-worker-restart=MAXWORKERRESTART maximum number of workers that can be restarted when crashed (set to zero to disable this feature) --dist=distmode set mode for distributing tests to exec environments. each: send each test to all available environments. load: load balance by sending any pending test to any available environment. loadscope: load balance by sending pending groups of tests in the same scope to any available environment. loadfile: load balance by sending test grouped by file to any available environment. (default) no: run tests inprocess, don't distribute. --tx=xspec add a test execution environment. some examples: --tx popen//python=python2.5 --tx socket=192.168.1.102:8888 --tx ssh=user@codespeak.net//chdir=testcache -d load-balance tests. shortcut for '--dist=load' --rsyncdir=DIR add directory for rsyncing to remote tx nodes. --rsyncignore=GLOB add expression for ignores when rsyncing to remote tx nodes. --boxed backward compatibility alias for pytest-forked --forked --testrunuid=TESTRUNUID provide an identifier shared amongst all workers as the value of the 'testrun_uid' fixture, ,if not provided, 'testrun_uid' is filled with a new unique string on every test run. -f, --looponfail run tests in subprocess, wait for modified files and re- run failing test set until all pass.

Dash Integration Tests: --webdriver={Chrome,Firefox} Name of the selenium driver to use --remote instruct pytest to use selenium grid --remote-url=REMOTE_URL set a different selenium grid remote url if other than default --headless set this flag to run in headless mode --percy-assets=PERCY_ASSETS configure how Percy will discover your app's assets --nopercyfinalize set this flag to control percy finalize at CI level --pause pause using pdb after opening the test app, so you can interact with it

forked subprocess test execution: --forked box each test run in a separate process (unix)

custom options: --metadata=key value additional metadata. --metadata-from-json=METADATA_FROM_JSON additional metadata from a json string.

[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found:

markers (linelist): markers for test functions empty_parameter_set_mark (string): default marker for empty parametersets norecursedirs (args): directory patterns to avoid for recursion testpaths (args): directories to search for tests when no files or directories are given in the command line. filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings. usefixtures (args): list of default fixtures to be used with this project python_files (args): glob-style file patterns for Python test module discovery python_classes (args): prefixes or glob names for Python test class discovery python_functions (args): prefixes or glob names for Python test function and method discovery disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool): disable string escape non-ascii characters, might cause unwanted side effects(use at your own risk) console_output_style (string): console output: "classic", or with additional progress information ("progress" (percentage) | "count"). xfail_strict (bool): default for the strict parameter of xfail markers when not given explicitly (default: False) enable_assertion_pass_hook (bool): Enables the pytest_assertion_pass hook.Make sure to delete any previously generated pyc cache files. junit_suite_name (string): Test suite name for JUnit report junit_logging (string): Write captured log messages to JUnit report: one of no|log|system-out|system-err|out-err|all junit_log_passing_tests (bool): Capture log information for passing tests to JUnit report: junit_duration_report (string): Duration time to report: one of total|call junit_family (string): Emit XML for schema: one of legacy|xunit1|xunit2 doctest_optionflags (args): option flags for doctests doctest_encoding (string): encoding used for doctest files cache_dir (string): cache directory path. log_level (string): default value for --log-level log_format (string): default value for --log-format log_date_format (string): default value for --log-date-format log_cli (bool): enable log display during test run (also known as "live logging"). log_cli_level (string): default value for --log-cli-level log_cli_format (string): default value for --log-cli-format log_cli_date_format (string): default value for --log-cli-date-format log_file (string): default value for --log-file log_file_level (string): default value for --log-file-level log_file_format (string): default value for --log-file-format log_file_date_format (string): default value for --log-file-date-format log_auto_indent (string): default value for --log-auto-indent faulthandler_timeout (string): Dump the traceback of all threads if a test takes more than TIMEOUT seconds to finish. addopts (args): extra command line options minversion (string): minimally required pytest version required_plugins (args): plugins that must be present for pytest to run rsyncdirs (pathlist): list of (relative) paths to be rsynced for remote distributed testing. rsyncignore (pathlist): list of (relative) glob-style paths to be ignored for rsyncing. looponfailroots (pathlist): directories to check for changes

environment variables: PYTEST_ADDOPTS extra command line options PYTEST_PLUGINS comma-separated plugins to load during startup PYTEST_DISABLE_PLUGIN_AUTOLOAD set to disable plugin auto-loading PYTEST_DEBUG set to enable debug tracing of pytest's internals

to see available markers type: pytest --markers to see available fixtures type: pytest --fixtures (shown according to specified file_ordir or current dir if not specified; fixtures with leading '' are only shown with the '-v' option

matthewxuda commented 2 years ago

usage: pytest [options] [file_or_dir] [file_or_dir] [...]

positional arguments: file_or_dir

general: -k EXPRESSION only run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. Example: -k 'test_method or test_other' matches all test functions and classes whose name contains 'test_method' or 'test_other', while -k 'not test_method' matches those that don't contain 'test_method' in their names. -k 'not test_method and not test_other' will eliminate the matches. Additionally keywords are matched to classes and functions containing extra names in their 'extra_keywordmatches' set, as well as functions which have names assigned directly to them. The matching is case-insensitive. -m MARKEXPR only run tests matching given mark expression. For example: -m 'mark1 and not mark2'. --markers show markers (builtin, plugin and per-project ones). -x, --exitfirst exit instantly on first error or failed test. --fixtures, --funcargs show available fixtures, sorted by plugin appearance (fixtures with leading '' are only shown with '-v') --fixtures-per-test show fixtures per test --pdb start the interactive Python debugger on errors or KeyboardInterrupt. --pdbcls=modulename:classname start a custom interactive Python debugger on errors. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb --trace Immediately break when running each test. --capture=method per-test capturing method: one of fd|sys|no|tee-sys. -s shortcut for --capture=no. --runxfail report the results of xfail tests as if they were not marked --lf, --last-failed rerun only the tests that failed at the last run (or all if none failed) --ff, --failed-first run all tests, but run the last failures first. This may re-order tests and thus lead to repeated fixture setup/teardown. --nf, --new-first run tests from new files first, then the rest of the tests sorted by file mtime --cache-show=[CACHESHOW] show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). --cache-clear remove all cache contents at start of test run. --lfnf={all,none}, --last-failed-no-failures={all,none} which tests to run with no previously (known) failures. --sw, --stepwise exit on test failure and continue from last failing test next time --sw-skip, --stepwise-skip ignore the first failing test but stop on the next failing test

reporting: --durations=N show N slowest setup/test durations (N=0 for all). --durations-min=N Minimal duration in seconds for inclusion in slowest list. Default 0.005 -v, --verbose increase verbosity. --no-header disable header --no-summary disable summary -q, --quiet decrease verbosity. --verbosity=VERBOSE set verbosity. Default is 0. -r chars show extra test summary info as specified by chars: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). --disable-warnings, --disable-pytest-warnings disable warnings summary -l, --showlocals show locals in tracebacks (disabled by default). --tb=style traceback print mode (auto/long/short/line/native/no). --show-capture={no,stdout,stderr,log,all} Controls how captured stdout/stderr/log is shown on failed tests. Default is 'all'. --full-trace don't cut any tracebacks (default is to cut). --color=color color terminal output (yes/no/auto). --code-highlight={yes,no} Whether code should be highlighted (only if --color is also enabled) --pastebin=mode send failed|all info to bpaste.net pastebin service. --junit-xml=path create junit-xml style report file at given path. --junit-prefix=str prepend prefix to classnames in junit-xml output --html=path create html report file at given path. --self-contained-html create a self-contained html file containing all necessary styles, scripts, and images - this means that the report may not render or function where CSP restrictions are in place (see https://developer.mozilla.org/docs/Web/Security/CSP) --css=path append given css file content to report style file.

pytest-warnings: -W PYTHONWARNINGS, --pythonwarnings=PYTHONWARNINGS set which warnings to report, see -W option of python itself. --maxfail=num exit after first num failures or errors. --strict-config any warnings encountered while parsing the pytest section of the configuration file raise errors. --strict-markers markers not registered in the markers section of the configuration file raise errors. --strict (deprecated) alias to --strict-markers. -c file load configuration from file instead of trying to locate one of the implicit configuration files. --continue-on-collection-errors Force test execution even if collection errors occur. --rootdir=ROOTDIR Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'.

collection: --collect-only, --co only collect tests, don't execute them. --pyargs try to interpret all arguments as python packages. --ignore=path ignore path during collection (multi-allowed). --ignore-glob=path ignore path pattern during collection (multi-allowed). --deselect=nodeid_prefix deselect item (via node id prefix) during collection (multi-allowed). --confcutdir=dir only load conftest.py's relative to specified dir. --noconftest Don't load any conftest.py files. --keep-duplicates Keep duplicate tests. --collect-in-virtualenv Don't ignore tests in a local virtualenv directory --import-mode={prepend,append,importlib} prepend/append to sys.path when importing test modules and conftest files, default is to prepend. --doctest-modules run doctests in all .py modules --doctest-report={none,cdiff,ndiff,udiff,only_first_failure} choose another output format for diffs on doctest failure --doctest-glob=pat doctests file matching pattern, default: test*.txt --doctest-ignore-import-errors ignore doctest ImportErrors --doctest-continue-on-failure for a given doctest, continue to run after the first failure

test session debugging and configuration: --basetemp=dir base temporary directory for this test run.(warning: this directory is removed if it exists) -V, --version display pytest version and information about plugins.When given twice, also display information about plugins. -h, --help show help message and configuration info -p name early-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use the no: prefix, e.g. no:doctest. --trace-config trace considerations of conftest.py files. --debug store internal tracing debug information in 'pytestdebug.log'. -o OVERRIDE_INI, --override-ini=OVERRIDE_INI override ini option with "option=value" style, e.g. -o xfail_strict=True -o cache_dir=cache. --assert=MODE Control assertion debugging tools. 'plain' performs no assertion debugging. 'rewrite' (the default) rewrites assert statements in test modules on import to provide assert expression information. --setup-only only setup fixtures, do not execute tests. --setup-show show setup of fixtures while executing tests. --setup-plan show what fixtures and tests would be executed but don't execute anything.

logging: --log-level=LEVEL level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's effective level, where it is "WARNING" by default. --log-format=LOG_FORMAT log format as used by the logging module. --log-date-format=LOG_DATE_FORMAT log date format as used by the logging module. --log-cli-level=LOG_CLI_LEVEL cli logging level. --log-cli-format=LOG_CLI_FORMAT log format as used by the logging module. --log-cli-date-format=LOG_CLI_DATE_FORMAT log date format as used by the logging module. --log-file=LOG_FILE path to a file when logging will be written to. --log-file-level=LOG_FILE_LEVEL log file logging level. --log-file-format=LOG_FILE_FORMAT log format as used by the logging module. --log-file-date-format=LOG_FILE_DATE_FORMAT log date format as used by the logging module. --log-auto-indent=LOG_AUTO_INDENT Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.

re-run failing tests to eliminate flaky failures: --only-rerun=ONLY_RERUN If passed, only rerun errors matching the regex provided. Pass this flag multiple times to accumulate a list of regexes to match --reruns=RERUNS number of times to re-run failed tests. defaults to 0. --reruns-delay=RERUNS_DELAY add time (seconds) delay between reruns.

distributed and subprocess testing: -n numprocesses, --numprocesses=numprocesses Shortcut for '--dist=load --tx=NUM*popen'. With 'auto', attempt to detect physical CPU count. With 'logical', detect logical CPU count. If physical CPU count cannot be found, falls back to logical count. This will be 0 when used with --pdb. --maxprocesses=maxprocesses limit the maximum number of workers to process the tests when using --numprocesses=auto --max-worker-restart=MAXWORKERRESTART maximum number of workers that can be restarted when crashed (set to zero to disable this feature) --dist=distmode set mode for distributing tests to exec environments. each: send each test to all available environments. load: load balance by sending any pending test to any available environment. loadscope: load balance by sending pending groups of tests in the same scope to any available environment. loadfile: load balance by sending test grouped by file to any available environment. (default) no: run tests inprocess, don't distribute. --tx=xspec add a test execution environment. some examples: --tx popen//python=python2.5 --tx socket=192.168.1.102:8888 --tx ssh=user@codespeak.net//chdir=testcache -d load-balance tests. shortcut for '--dist=load' --rsyncdir=DIR add directory for rsyncing to remote tx nodes. --rsyncignore=GLOB add expression for ignores when rsyncing to remote tx nodes. --boxed backward compatibility alias for pytest-forked --forked --testrunuid=TESTRUNUID provide an identifier shared amongst all workers as the value of the 'testrun_uid' fixture, ,if not provided, 'testrun_uid' is filled with a new unique string on every test run. -f, --looponfail run tests in subprocess, wait for modified files and re- run failing test set until all pass.

Dash Integration Tests: --webdriver={Chrome,Firefox} Name of the selenium driver to use --remote instruct pytest to use selenium grid --remote-url=REMOTE_URL set a different selenium grid remote url if other than default --headless set this flag to run in headless mode --percy-assets=PERCY_ASSETS configure how Percy will discover your app's assets --nopercyfinalize set this flag to control percy finalize at CI level --pause pause using pdb after opening the test app, so you can interact with it

forked subprocess test execution: --forked box each test run in a separate process (unix)

custom options: --metadata=key value additional metadata. --metadata-from-json=METADATA_FROM_JSON additional metadata from a json string.

[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found:

markers (linelist): markers for test functions empty_parameter_set_mark (string): default marker for empty parametersets norecursedirs (args): directory patterns to avoid for recursion testpaths (args): directories to search for tests when no files or directories are given in the command line. filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings. usefixtures (args): list of default fixtures to be used with this project python_files (args): glob-style file patterns for Python test module discovery python_classes (args): prefixes or glob names for Python test class discovery python_functions (args): prefixes or glob names for Python test function and method discovery disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool): disable string escape non-ascii characters, might cause unwanted side effects(use at your own risk) console_output_style (string): console output: "classic", or with additional progress information ("progress" (percentage) | "count"). xfail_strict (bool): default for the strict parameter of xfail markers when not given explicitly (default: False) enable_assertion_pass_hook (bool): Enables the pytest_assertion_pass hook.Make sure to delete any previously generated pyc cache files. junit_suite_name (string): Test suite name for JUnit report junit_logging (string): Write captured log messages to JUnit report: one of no|log|system-out|system-err|out-err|all junit_log_passing_tests (bool): Capture log information for passing tests to JUnit report: junit_duration_report (string): Duration time to report: one of total|call junit_family (string): Emit XML for schema: one of legacy|xunit1|xunit2 doctest_optionflags (args): option flags for doctests doctest_encoding (string): encoding used for doctest files cache_dir (string): cache directory path. log_level (string): default value for --log-level log_format (string): default value for --log-format log_date_format (string): default value for --log-date-format log_cli (bool): enable log display during test run (also known as "live logging"). log_cli_level (string): default value for --log-cli-level log_cli_format (string): default value for --log-cli-format log_cli_date_format (string): default value for --log-cli-date-format log_file (string): default value for --log-file log_file_level (string): default value for --log-file-level log_file_format (string): default value for --log-file-format log_file_date_format (string): default value for --log-file-date-format log_auto_indent (string): default value for --log-auto-indent faulthandler_timeout (string): Dump the traceback of all threads if a test takes more than TIMEOUT seconds to finish. addopts (args): extra command line options minversion (string): minimally required pytest version required_plugins (args): plugins that must be present for pytest to run rsyncdirs (pathlist): list of (relative) paths to be rsynced for remote distributed testing. rsyncignore (pathlist): list of (relative) glob-style paths to be ignored for rsyncing. looponfailroots (pathlist): directories to check for changes

environment variables: PYTEST_ADDOPTS extra command line options PYTEST_PLUGINS comma-separated plugins to load during startup PYTEST_DISABLE_PLUGIN_AUTOLOAD set to disable plugin auto-loading PYTEST_DEBUG set to enable debug tracing of pytest's internals

to see available markers type: pytest --markers to see available fixtures type: pytest --fixtures (shown according to specified file_ordir or current dir if not specified; fixtures with leading '' are only shown with the '-v' option

matthewxuda commented 2 years ago

this is the information when i run pytest -h, and how to get the other conflict is, thanks a lot

mdmintz commented 2 years ago

@matthewxuda "Dash Integration Tests" is causing the conflict. You need to uninstall the following:

dash 2.0.0
dash-bootstrap-components 1.0.0
dash-colorscales 0.0.4
dash-core-components 2.0.0
dash-daq 0.5.0
dash-html-components 2.0.0
dash-table 5.0.0
matthewxuda commented 2 years ago

Oh, My God, thanks a lot again, it works, thank you very much :)

matthewxuda commented 2 years ago

Oh, My God, thanks a lot again, it works, thank you very much :)

docsteveharris commented 2 years ago

@matthewxuda "Dash Integration Tests" is causing the conflict. You need to uninstall the following:

dash 2.0.0
dash-bootstrap-components 1.0.0
dash-colorscales 0.0.4
dash-core-components 2.0.0
dash-daq 0.5.0
dash-html-components 2.0.0
dash-table 5.0.0

I've got the same problem but wanted to use seleniumbase to test my dash app. I can get seleniumbase to work but not if I have dash installed alongside. Am I misunderstanding the purpose of seleniumbase since this answer implies that I should not expect to use seleniumbase for testing my app.

Thanks in advance, and apologies if I've missed something obvious.

mdmintz commented 2 years ago

@docsteveharris It's possible: You just need to install seleniumbase in a separate Python virtual environment from dash, as they both define --headless as a command-line option. Only one pytest-plugin can define the same command-line option at a time, as otherwise there would be conflicts.

Alternatively, you could run seleniumbase tests using nosetests instead of pytest, and that would also avoid conflicts. Some command-line options will be different and/or missing, but all the major ones exist when running seleniumbase tests via nosetests.

NarcisWithTreasure commented 5 months ago

thanks