Created
January 19, 2021 15:10
-
-
Save progapandist/7db084471c6936be33f2d4037723f4e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/00-Setup/02-Git | |
[1mcollecting ... [0mcollected 2 items | |
tests/test_git.py::TestGit::test_hi_my_name_is [32mPASSED[0m[32m [ 50%][0m | |
tests/test_git.py::TestGit::test_my_buddy_is [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m2 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/00-Setup/01-Check | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_demo.py::TestDemo::test_returns_3_14_for_radius_1 [32mPASSED[0m[32m [ 33%][0m | |
tests/test_demo.py::TestDemo::test_returns_78_5_for_radius_5 [32mPASSED[0m[32m [ 66%][0m | |
tests/test_demo.py::TestDemo::test_returns_zero_for_negative_radius [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/03-Text-Extraction-with-Regex | |
[1mcollecting ... [0mcollected 10 items | |
tests/test_patterns.py::TestPatterns::test_amount_group_pattern [32mPASSED[0m[32m [ 10%][0m | |
tests/test_patterns.py::TestPatterns::test_amount_pattern [32mPASSED[0m[32m [ 20%][0m | |
tests/test_patterns.py::TestPatterns::test_date_pattern [32mPASSED[0m[32m [ 30%][0m | |
tests/test_patterns.py::TestPatterns::test_quantity_group_pattern [32mPASSED[0m[32m [ 40%][0m | |
tests/test_patterns.py::TestPatterns::test_quantity_pattern [32mPASSED[0m[32m [ 50%][0m | |
tests/test_patterns.py::TestPatterns::test_zip_code_pattern [32mPASSED[0m[32m [ 60%][0m | |
tests/test_receipts.py::TestReceipts::test_receipt [32mPASSED[0m[32m [ 70%][0m | |
tests/test_receipts.py::TestReceipts::test_receipts_df_size [32mPASSED[0m[32m [ 80%][0m | |
tests/test_receipts.py::TestReceipts::test_receipts_dict [32mPASSED[0m[32m [ 90%][0m | |
tests/test_receipts.py::TestReceipts::test_receipts_list [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m10 passed[0m[32m in 0.42s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/00-Warmup | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_opengraph.py::TestOpenGraph::test_a_com [32mPASSED[0m[32m [ 25%][0m | |
tests/test_opengraph.py::TestOpenGraph::test_empty_url [32mPASSED[0m[32m [ 50%][0m | |
tests/test_opengraph.py::TestOpenGraph::test_lewagon_com [32mPASSED[0m[32m [ 75%][0m | |
tests/test_warmup.py::TestWarmup::test_dataframe_has_new_columns [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 1.52s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/01-Stock-Market-API | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_apple.py::TestApple::test_apple_df_columns [31mFAILED[0m[31m [ 33%][0m | |
tests/test_apple.py::TestApple::test_apple_df_index_is_timestamp [32mPASSED[0m[31m [ 66%][0m | |
tests/test_apple.py::TestApple::test_apple_df_index_name_is_date [32mPASSED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_______________________ TestApple.test_apple_df_columns ________________________[0m | |
self = <tests.test_apple.TestApple testMethod=test_apple_df_columns> | |
[94mdef[39;49;00m [92mtest_apple_df_columns[39;49;00m([96mself[39;49;00m): | |
> [96mself[39;49;00m.assertEqual( | |
[96mlist[39;49;00m([96mself[39;49;00m.result.columns), | |
[96msorted[39;49;00m([ | |
[33m'[39;49;00m[33mclose[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mhigh[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mlow[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mopen[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33msymbol[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mvolume[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mid[39;49;00m[33m'[39;49;00m, | |
[33m'[39;49;00m[33mkey[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33msubkey[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mupdated[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mchangeOverTime[39;49;00m[33m'[39;49;00m, | |
[33m'[39;49;00m[33mmarketChangeOverTime[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33muOpen[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33muClose[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33muHigh[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33muLow[39;49;00m[33m'[39;49;00m, | |
[33m'[39;49;00m[33muVolume[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mfOpen[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mfClose[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mfHigh[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mfLow[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mfVolume[39;49;00m[33m'[39;49;00m, | |
[33m'[39;49;00m[33mlabel[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mchange[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mchangePercent[39;49;00m[33m'[39;49;00m | |
]) | |
) | |
[1m[31mE AssertionError: Lists differ: ['close', 'high', 'low', 'open', 'symbol', '[225 chars]ode'] != ['change', 'changeOverTime', 'changePercent'[209 chars]ume'][0m | |
[1m[31mE [0m | |
[1m[31mE First differing element 0:[0m | |
[1m[31mE 'close'[0m | |
[1m[31mE 'change'[0m | |
[1m[31mE [0m | |
[1m[31mE First list contains 1 additional elements.[0m | |
[1m[31mE First extra element 25:[0m | |
[1m[31mE 'company_code'[0m | |
[1m[31mE [0m | |
[1m[31mE + ['change',[0m | |
[1m[31mE + 'changeOverTime',[0m | |
[1m[31mE + 'changePercent',[0m | |
[1m[31mE - ['close',[0m | |
[1m[31mE ? ^[0m | |
[1m[31mE [0m | |
[1m[31mE + 'close',[0m | |
[1m[31mE ? ^[0m | |
[1m[31mE [0m | |
[1m[31mE + 'fClose',[0m | |
[1m[31mE + 'fHigh',[0m | |
[1m[31mE + 'fLow',[0m | |
[1m[31mE + 'fOpen',[0m | |
[1m[31mE + 'fVolume',[0m | |
[1m[31mE 'high',[0m | |
[1m[31mE - 'low',[0m | |
[1m[31mE - 'open',[0m | |
[1m[31mE - 'symbol',[0m | |
[1m[31mE - 'volume',[0m | |
[1m[31mE 'id',[0m | |
[1m[31mE 'key',[0m | |
[1m[31mE + 'label',[0m | |
[1m[31mE + 'low',[0m | |
[1m[31mE + 'marketChangeOverTime',[0m | |
[1m[31mE + 'open',[0m | |
[1m[31mE 'subkey',[0m | |
[1m[31mE + 'symbol',[0m | |
[1m[31mE - 'updated',[0m | |
[1m[31mE - 'changeOverTime',[0m | |
[1m[31mE - 'marketChangeOverTime',[0m | |
[1m[31mE - 'uOpen',[0m | |
[1m[31mE 'uClose',[0m | |
[1m[31mE 'uHigh',[0m | |
[1m[31mE 'uLow',[0m | |
[1m[31mE + 'uOpen',[0m | |
[1m[31mE 'uVolume',[0m | |
[1m[31mE + 'updated',[0m | |
[1m[31mE - 'fOpen',[0m | |
[1m[31mE - 'fClose',[0m | |
[1m[31mE - 'fHigh',[0m | |
[1m[31mE - 'fLow',[0m | |
[1m[31mE - 'fVolume',[0m | |
[1m[31mE ? ^^ ^[0m | |
[1m[31mE [0m | |
[1m[31mE + 'volume'][0m | |
[1m[31mE ? ^ ^[0m | |
[1m[31mE [0m | |
[1m[31mE - 'label',[0m | |
[1m[31mE - 'change',[0m | |
[1m[31mE - 'changePercent',[0m | |
[1m[31mE - 'company_code'][0m | |
[1m[31mtests/test_apple.py[0m:13: AssertionError | |
=========================== short test summary info ============================ | |
FAILED tests/test_apple.py::TestApple::test_apple_df_columns - AssertionError... | |
[31m========================= [31m[1m1 failed[0m, [32m2 passed[0m[31m in 0.45s[0m[31m ==========================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/02-Data-Sourcing/02-Scraping | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_books.py::TestBooks::test_books_df_columns_name [32mPASSED[0m[32m [ 16%][0m | |
tests/test_books.py::TestBooks::test_books_df_columns_size [32mPASSED[0m[32m [ 33%][0m | |
tests/test_books.py::TestBooks::test_books_dict_id_defined [32mPASSED[0m[32m [ 50%][0m | |
tests/test_books.py::TestBooks::test_first_book_price [32mPASSED[0m[32m [ 66%][0m | |
tests/test_books.py::TestBooks::test_first_book_rating [32mPASSED[0m[32m [ 83%][0m | |
tests/test_books.py::TestBooks::test_first_book_title [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m6 passed[0m[32m in 0.35s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module quiz[0m | |
quiz.py:10:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:24:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:38:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:52:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:68:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:82:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
quiz.py:98:4: W0612: [35mUnused variable 'possible_answers'[0m ([35munused-variable[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 7.50/10 (previous run: 7.50/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/03-Data-Visualization/05-Caveats-Quiz | |
[1mcollecting ... [0mcollected 7 items | |
tests/test_caveat.py::TestCaveatQuiz::test_question_bar_plot [32mPASSED[0m[32m [ 14%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_bar_plot_columns [32mPASSED[0m[32m [ 28%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_color_blind_palette [32mPASSED[0m[32m [ 42%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_color_palette [32mPASSED[0m[32m [ 57%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_color_uses [32mPASSED[0m[32m [ 71%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_diverging_color_palette [32mPASSED[0m[32m [ 85%][0m | |
tests/test_caveat.py::TestCaveatQuiz::test_question_line_plot [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m7 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/03-Multiple-Files-With-Pandas | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_olympic_games.py::TestOlympicGames::test_all_countries_df_shape [32mPASSED[0m[32m [ 33%][0m | |
tests/test_olympic_games.py::TestOlympicGames::test_summer_countries_df_shape [32mPASSED[0m[32m [ 66%][0m | |
tests/test_olympic_games.py::TestOlympicGames::test_top_10_countries_medals [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.13s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/01-Numpy | |
[1mcollecting ... [0mcollected 5 items | |
tests/test_numpy.py::TestNumpy::test_advanced_matrixes_manipulation [32mPASSED[0m[32m [ 20%][0m | |
tests/test_numpy.py::TestNumpy::test_linear_twenty_vector_creation [32mPASSED[0m[32m [ 40%][0m | |
tests/test_numpy.py::TestNumpy::test_matrixes_creation_and_reshaping [32mPASSED[0m[32m [ 60%][0m | |
tests/test_numpy.py::TestNumpy::test_ndarrays_creation [32mPASSED[0m[32m [ 80%][0m | |
tests/test_numpy.py::TestNumpy::test_vectors_creation [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m5 passed[0m[32m in 0.14s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/01-Notebook | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_hello.py::TestHelloWorld::test_says_hello [32mPASSED[0m[32m [ 33%][0m | |
tests/test_import_hello.py::TestImportHello::test_method_returns_a_string [32mPASSED[0m[32m [ 66%][0m | |
tests/test_import_hello.py::TestImportHello::test_method_returns_correct_sentence [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/02-Data-Toolkit/01-Data-Analysis/02-US-Oil-and-Gas-Production | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_gas.py::TestGas::test_month_column_is_a_datetime [32mPASSED[0m[32m [ 25%][0m | |
tests/test_gas.py::TestGas::test_yearly_gas_production_df_has_the_right_shape [32mPASSED[0m[32m [ 50%][0m | |
tests/test_merged_dataframes.py::TestMergedDataframes::test_merged_df_has_the_right_shape [32mPASSED[0m[32m [ 75%][0m | |
tests/test_merged_dataframes.py::TestMergedDataframes::test_yearly_oil_value_2008 [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 0.13s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module seller_solution[0m | |
seller_solution.py:21:0: C0301: [1mLine too long (120/100)[0m ([1mline-too-long[0m) | |
seller_solution.py:39:0: C0301: [1mLine too long (106/100)[0m ([1mline-too-long[0m) | |
seller_solution.py:40:0: C0301: [1mLine too long (108/100)[0m ([1mline-too-long[0m) | |
seller_solution.py:55:0: C0301: [1mLine too long (102/100)[0m ([1mline-too-long[0m) | |
seller_solution.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
seller_solution.py:3:0: E0401: [1;31mUnable to import 'olist.data'[0m ([1;31mimport-error[0m) | |
seller_solution.py:4:0: E0401: [1;31mUnable to import 'olist.order'[0m ([1;31mimport-error[0m) | |
seller_solution.py:7:0: C0115: [1mMissing class docstring[0m ([1mmissing-class-docstring[0m) | |
seller_solution.py:44:8: C0103: [1mArgument name "d" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
seller_solution.py:48:12: R1705: [1;3;35mUnnecessary "else" after "return"[0m ([1;3;35mno-else-return[0m) | |
seller_solution.py:53:8: C0103: [1mArgument name "d" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
seller_solution.py:69:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
seller_solution.py:102:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
seller_solution.py:103:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 6.56/10 (previous run: 6.56/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers | |
[1mcollecting ... [0mcollected 8 items | |
tests/test_seller.py::TestSeller::test_average_delay_carrier [31mFAILED[0m[31m [ 12%][0m | |
tests/test_seller.py::TestSeller::test_average_review_score [31mFAILED[0m[31m [ 25%][0m | |
tests/test_seller.py::TestSeller::test_average_sales [31mFAILED[0m[31m [ 37%][0m | |
tests/test_seller.py::TestSeller::test_columns [31mFAILED[0m[31m [ 50%][0m | |
tests/test_seller.py::TestSeller::test_quantity [31mFAILED[0m[31m [ 62%][0m | |
tests/test_seller.py::TestSeller::test_shape [31mFAILED[0m[31m [ 75%][0m | |
tests/test_seller.py::TestSeller::test_unique_state [31mFAILED[0m[31m [ 87%][0m | |
tests/test_seller.py::TestSeller::test_wait_time [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m____________________ TestSeller.test_average_delay_carrier _____________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_average_delay_carrier> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m_____________________ TestSeller.test_average_review_score _____________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_average_review_score> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m________________________ TestSeller.test_average_sales _________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_average_sales> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m___________________________ TestSeller.test_columns ____________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_columns> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m___________________________ TestSeller.test_quantity ___________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_quantity> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m____________________________ TestSeller.test_shape _____________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_shape> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m_________________________ TestSeller.test_unique_state _________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_unique_state> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m__________________________ TestSeller.test_wait_time ___________________________[0m | |
self = <tests.test_seller.TestSeller testMethod=test_wait_time> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/02-Sellers/tests/seller.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_seller.py::TestSeller::test_average_delay_carrier - FileNot... | |
FAILED tests/test_seller.py::TestSeller::test_average_review_score - FileNotF... | |
FAILED tests/test_seller.py::TestSeller::test_average_sales - FileNotFoundErr... | |
FAILED tests/test_seller.py::TestSeller::test_columns - FileNotFoundError: [E... | |
FAILED tests/test_seller.py::TestSeller::test_quantity - FileNotFoundError: [... | |
FAILED tests/test_seller.py::TestSeller::test_shape - FileNotFoundError: [Err... | |
FAILED tests/test_seller.py::TestSeller::test_unique_state - FileNotFoundErro... | |
FAILED tests/test_seller.py::TestSeller::test_wait_time - FileNotFoundError: ... | |
[31m============================== [31m[1m8 failed[0m[31m in 0.16s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module product[0m | |
product.py:42:0: C0301: [1mLine too long (122/100)[0m ([1mline-too-long[0m) | |
product.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
product.py:3:0: E0401: [1;31mUnable to import 'olist.data'[0m ([1;31mimport-error[0m) | |
product.py:4:0: E0401: [1;31mUnable to import 'olist.order'[0m ([1;31mimport-error[0m) | |
product.py:7:0: C0115: [1mMissing class docstring[0m ([1mmissing-class-docstring[0m) | |
product.py:28:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
product.py:53:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
product.py:73:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
product.py:75:8: C0103: [1mVariable name "df" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
product.py:114:4: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
product.py:1:0: W0611: [35mUnused pandas imported as pd[0m ([35munused-import[0m) | |
product.py:2:0: W0611: [35mUnused numpy imported as np[0m ([35munused-import[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 5.56/10 (previous run: 5.56/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_products.py::TestProducts::test_average_price [31mFAILED[0m[31m [ 25%][0m | |
tests/test_products.py::TestProducts::test_average_quantity [31mFAILED[0m[31m [ 50%][0m | |
tests/test_products.py::TestProducts::test_average_review_score [31mFAILED[0m[31m [ 75%][0m | |
tests/test_products.py::TestProducts::test_shape [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_______________________ TestProducts.test_average_price ________________________[0m | |
self = <tests.test_products.TestProducts testMethod=test_average_price> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m______________________ TestProducts.test_average_quantity ______________________[0m | |
self = <tests.test_products.TestProducts testMethod=test_average_quantity> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m____________________ TestProducts.test_average_review_score ____________________[0m | |
self = <tests.test_products.TestProducts testMethod=test_average_review_score> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m___________________________ TestProducts.test_shape ____________________________[0m | |
self = <tests.test_products.TestProducts testMethod=test_shape> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/03-Linear-Regression/Optional-Products/tests/products.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_products.py::TestProducts::test_average_price - FileNotFoun... | |
FAILED tests/test_products.py::TestProducts::test_average_quantity - FileNotF... | |
FAILED tests/test_products.py::TestProducts::test_average_review_score - File... | |
FAILED tests/test_products.py::TestProducts::test_shape - FileNotFoundError: ... | |
[31m============================== [31m[1m4 failed[0m[31m in 0.13s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module order_solution[0m | |
order_solution.py:25:0: C0301: [1mLine too long (116/100)[0m ([1mline-too-long[0m) | |
order_solution.py:47:0: C0301: [1mLine too long (107/100)[0m ([1mline-too-long[0m) | |
order_solution.py:181:0: C0301: [1mLine too long (103/100)[0m ([1mline-too-long[0m) | |
order_solution.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
order_solution.py:4:0: E0401: [1;31mUnable to import 'olist.utils'[0m ([1;31mimport-error[0m) | |
order_solution.py:5:0: E0401: [1;31mUnable to import 'olist.data'[0m ([1;31mimport-error[0m) | |
order_solution.py:46:8: C0103: [1mArgument name "x" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
order_solution.py:49:12: R1705: [1;3;35mUnnecessary "else" after "return"[0m ([1;3;35mno-else-return[0m) | |
order_solution.py:78:8: C0103: [1mArgument name "d" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
order_solution.py:79:12: R1705: [1;3;35mUnnecessary "else" after "return"[0m ([1;3;35mno-else-return[0m) | |
order_solution.py:84:8: C0103: [1mArgument name "d" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
order_solution.py:85:12: R1705: [1;3;35mUnnecessary "else" after "return"[0m ([1;3;35mno-else-return[0m) | |
order_solution.py:1:0: W0611: [35mUnused import os[0m ([35munused-import[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 7.08/10 (previous run: 7.08/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_reviews.py::TestReviews::test_dim_five_star [31mFAILED[0m[31m [ 16%][0m | |
tests/test_reviews.py::TestReviews::test_dim_not_five_star [31mFAILED[0m[31m [ 33%][0m | |
tests/test_reviews.py::TestReviews::test_dim_not_one_star [31mFAILED[0m[31m [ 50%][0m | |
tests/test_reviews.py::TestReviews::test_dim_one_star [31mFAILED[0m[31m [ 66%][0m | |
tests/test_training.py::TestTraining::test_training_data_columns [31mFAILED[0m[31m [ 83%][0m | |
tests/test_training.py::TestTraining::test_training_data_shape [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m________________________ TestReviews.test_dim_five_star ________________________[0m | |
self = <tests.test_reviews.TestReviews testMethod=test_dim_five_star> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m______________________ TestReviews.test_dim_not_five_star ______________________[0m | |
self = <tests.test_reviews.TestReviews testMethod=test_dim_not_five_star> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m______________________ TestReviews.test_dim_not_one_star _______________________[0m | |
self = <tests.test_reviews.TestReviews testMethod=test_dim_not_one_star> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m________________________ TestReviews.test_dim_one_star _________________________[0m | |
self = <tests.test_reviews.TestReviews testMethod=test_dim_one_star> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/reviews.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m___________________ TestTraining.test_training_data_columns ____________________[0m | |
self = <tests.test_training.TestTraining testMethod=test_training_data_columns> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/training.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m____________________ TestTraining.test_training_data_shape _____________________[0m | |
self = <tests.test_training.TestTraining testMethod=test_training_data_shape> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/02-Statistical-Inference/01-Orders/tests/training.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_reviews.py::TestReviews::test_dim_five_star - FileNotFoundE... | |
FAILED tests/test_reviews.py::TestReviews::test_dim_not_five_star - FileNotFo... | |
FAILED tests/test_reviews.py::TestReviews::test_dim_not_one_star - FileNotFou... | |
FAILED tests/test_reviews.py::TestReviews::test_dim_one_star - FileNotFoundEr... | |
FAILED tests/test_training.py::TestTraining::test_training_data_columns - Fil... | |
FAILED tests/test_training.py::TestTraining::test_training_data_shape - FileN... | |
[31m============================== [31m[1m6 failed[0m[31m in 0.15s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit | |
[1mcollecting ... [0mcollected 2 items | |
tests/test_logit_five.py::TestLogitFive::test_intercept_five [31mFAILED[0m[31m [ 50%][0m | |
tests/test_logit_one.py::TestLogitOne::test_intercept_one [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m______________________ TestLogitFive.test_intercept_five _______________________[0m | |
self = <tests.test_logit_five.TestLogitFive testMethod=test_intercept_five> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit/tests/logit_five.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m_______________________ TestLogitOne.test_intercept_one ________________________[0m | |
self = <tests.test_logit_one.TestLogitOne testMethod=test_intercept_one> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/04-Logistic-Regression/01-Logit/tests/logit_one.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_logit_five.py::TestLogitFive::test_intercept_five - FileNot... | |
FAILED tests/test_logit_one.py::TestLogitOne::test_intercept_one - FileNotFou... | |
[31m============================== [31m[1m2 failed[0m[31m in 0.13s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_orders.py::TestOrders::test_key_names [31mFAILED[0m[31m [ 33%][0m | |
tests/test_orders.py::TestOrders::test_keys_len [31mFAILED[0m[31m [ 66%][0m | |
tests/test_orders.py::TestOrders::test_reviews_number [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m__________________________ TestOrders.test_key_names ___________________________[0m | |
self = <tests.test_orders.TestOrders testMethod=test_key_names> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m___________________________ TestOrders.test_keys_len ___________________________[0m | |
self = <tests.test_orders.TestOrders testMethod=test_keys_len> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m________________________ TestOrders.test_reviews_number ________________________[0m | |
self = <tests.test_orders.TestOrders testMethod=test_reviews_number> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/Optional-Metric-Design/tests/orders.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_orders.py::TestOrders::test_key_names - FileNotFoundError: ... | |
FAILED tests/test_orders.py::TestOrders::test_keys_len - FileNotFoundError: [... | |
FAILED tests/test_orders.py::TestOrders::test_reviews_number - FileNotFoundEr... | |
[31m============================== [31m[1m3 failed[0m[31m in 0.13s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis | |
[1mcollecting ... [0mcollected 2 items | |
tests/test_matching_table.py::TestMatchingTable::test_columns [31mFAILED[0m[31m [ 50%][0m | |
tests/test_matching_table.py::TestMatchingTable::test_shape [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m________________________ TestMatchingTable.test_columns ________________________[0m | |
self = <tests.test_matching_table.TestMatchingTable testMethod=test_columns> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis/tests/matching_table.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m_________________________ TestMatchingTable.test_shape _________________________[0m | |
self = <tests.test_matching_table.TestMatchingTable testMethod=test_shape> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/03-Exploratory-Analysis/tests/matching_table.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_matching_table.py::TestMatchingTable::test_columns - FileNo... | |
FAILED tests/test_matching_table.py::TestMatchingTable::test_shape - FileNotF... | |
[31m============================== [31m[1m2 failed[0m[31m in 0.12s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module data_solution[0m | |
data_solution.py:13:0: C0301: [1mLine too long (129/100)[0m ([1mline-too-long[0m) | |
data_solution.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
data_solution.py:5:0: C0115: [1mMissing class docstring[0m ([1mmissing-class-docstring[0m) | |
data_solution.py:28:15: C0103: [1mVariable name "f" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
data_solution.py:6:4: R0201: [1;3;35mMethod could be a function[0m ([1;3;35mno-self-use[0m) | |
data_solution.py:52:4: R0201: [1;3;35mMethod could be a function[0m ([1;3;35mno-self-use[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 7.14/10 (previous run: 7.14/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_get_data.py::TestGetData::test_columns [31mFAILED[0m[31m [ 33%][0m | |
tests/test_get_data.py::TestGetData::test_keys [31mFAILED[0m[31m [ 66%][0m | |
tests/test_get_data.py::TestGetData::test_len [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m___________________________ TestGetData.test_columns ___________________________[0m | |
self = <tests.test_get_data.TestGetData testMethod=test_columns> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m____________________________ TestGetData.test_keys _____________________________[0m | |
self = <tests.test_get_data.TestGetData testMethod=test_keys> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
[31m[1m_____________________________ TestGetData.test_len _____________________________[0m | |
self = <tests.test_get_data.TestGetData testMethod=test_len> | |
[94mdef[39;49;00m [92msetUp[39;49;00m([96mself[39;49;00m): | |
[33m"""Load the pickle file"""[39;49;00m | |
klass = [96mself[39;49;00m.[91m__class__[39;49;00m.[91m__name__[39;49;00m | |
name = re.sub([33mr[39;49;00m[33m'[39;49;00m[33m(?<!^)(?=[A-Z])[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m_[39;49;00m[33m'[39;49;00m, klass).lower()[[96mlen[39;49;00m([33m'[39;49;00m[33mtest_[39;49;00m[33m'[39;49;00m):] | |
result_file = os.path.join(os.getcwd(), [33m"[39;49;00m[33mtests[39;49;00m[33m"[39;49;00m, [33mf[39;49;00m[33m"[39;49;00m[33m{[39;49;00mname[33m}[39;49;00m[33m.pickle[39;49;00m[33m"[39;49;00m) | |
> [96mself[39;49;00m.result = pickle.load([96mopen[39;49;00m(result_file, [33m'[39;49;00m[33mrb[39;49;00m[33m'[39;49;00m)) | |
[1m[31mE FileNotFoundError: [Errno 2] No such file or directory: '/Users/andybarnov/code/lewagon/data-solutions/04-Decision-Science/01-Project-Setup/02-Data-Preparation/tests/get_data.pickle'[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/nbresult/__init__.py[0m:52: FileNotFoundError | |
=========================== short test summary info ============================ | |
FAILED tests/test_get_data.py::TestGetData::test_columns - FileNotFoundError:... | |
FAILED tests/test_get_data.py::TestGetData::test_keys - FileNotFoundError: [E... | |
FAILED tests/test_get_data.py::TestGetData::test_len - FileNotFoundError: [Er... | |
[31m============================== [31m[1m3 failed[0m[31m in 0.13s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/00-Warmup | |
[1mcollecting ... [0mcollected 5 items | |
tests/test_school.py::TestSchool::test_barcelona [32mPASSED[0m[32m [ 20%][0m | |
tests/test_school.py::TestSchool::test_berlin [32mPASSED[0m[32m [ 40%][0m | |
tests/test_school.py::TestSchool::test_brussels [32mPASSED[0m[32m [ 60%][0m | |
tests/test_school.py::TestSchool::test_london [32mPASSED[0m[32m [ 80%][0m | |
tests/test_school.py::TestSchool::test_paris [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m5 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 9.20/10, +0.80) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/03-Rank-And-Partition | |
[1mcollecting ... [0mcollected 2 items | |
tests/test_queries.py::TestQueries::test_order_cumulative_amount_per_customer [32mPASSED[0m[32m [ 50%][0m | |
tests/test_queries.py::TestQueries::test_order_rank_per_customer [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m2 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/01-Query-the-DB | |
[1mcollecting ... [0mcollected 10 items | |
tests/test_get_orders_range.py::TestOrdersRange::test_len_results [32mPASSED[0m[32m [ 10%][0m | |
tests/test_get_orders_range.py::TestOrdersRange::test_results_0 [32mPASSED[0m[32m [ 20%][0m | |
tests/test_get_orders_range.py::TestOrdersRange::test_results_1 [32mPASSED[0m[32m [ 30%][0m | |
tests/test_get_orders_range.py::TestOrdersRange::test_type_results [32mPASSED[0m[32m [ 40%][0m | |
tests/test_get_waiting_time.py::TestWaitingTime::test_first_result [32mPASSED[0m[32m [ 50%][0m | |
tests/test_get_waiting_time.py::TestWaitingTime::test_last_result [32mPASSED[0m[32m [ 60%][0m | |
tests/test_get_waiting_time.py::TestWaitingTime::test_size_list [32mPASSED[0m[32m [ 70%][0m | |
tests/test_get_waiting_time.py::TestWaitingTime::test_type_results [32mPASSED[0m[32m [ 80%][0m | |
tests/test_query_orders.py::TestQueryOrders::test_first_element [32mPASSED[0m[32m [ 90%][0m | |
tests/test_query_orders.py::TestQueryOrders::test_length_list [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m10 passed[0m[32m in 0.05s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/02-Join-the-tables | |
[1mcollecting ... [0mcollected 15 items | |
tests/test_best_employee.py::TestBestEmployee::test_good_result [32mPASSED[0m[32m [ 6%][0m | |
tests/test_best_employee.py::TestBestEmployee::test_length_results [32mPASSED[0m[32m [ 13%][0m | |
tests/test_best_employee.py::TestBestEmployee::test_type_result [32mPASSED[0m[32m [ 20%][0m | |
tests/test_detailed_orders.py::TestDetailOrders::test_first_results [32mPASSED[0m[32m [ 26%][0m | |
tests/test_detailed_orders.py::TestDetailOrders::test_last_results [32mPASSED[0m[32m [ 33%][0m | |
tests/test_detailed_orders.py::TestDetailOrders::test_length_results [32mPASSED[0m[32m [ 40%][0m | |
tests/test_detailed_orders.py::TestDetailOrders::test_type_results [32mPASSED[0m[32m [ 46%][0m | |
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_first_result [32mPASSED[0m[32m [ 53%][0m | |
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_last_result [32mPASSED[0m[32m [ 60%][0m | |
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_length_results [32mPASSED[0m[32m [ 66%][0m | |
tests/test_orders_per_customer.py::TestOrdersPerCustomer::test_type_result [32mPASSED[0m[32m [ 73%][0m | |
tests/test_spent_per_customer.py::TestSpentCustomer::test_first_result [32mPASSED[0m[32m [ 80%][0m | |
tests/test_spent_per_customer.py::TestSpentCustomer::test_last_result [32mPASSED[0m[32m [ 86%][0m | |
tests/test_spent_per_customer.py::TestSpentCustomer::test_len_resultts [32mPASSED[0m[32m [ 93%][0m | |
tests/test_spent_per_customer.py::TestSpentCustomer::test_type_results [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m15 passed[0m[32m in 0.06s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/04-SQL-Advanced/04-Subquery-Refactoring | |
[1mcollecting ... [0mcollected 13 items | |
tests/test_average_number_of_days_between_orders.py::TestAverageNumberOfDaysBetweenOrders::test_result_type [32mPASSED[0m[32m [ 7%][0m | |
tests/test_average_number_of_days_between_orders.py::TestAverageNumberOfDaysBetweenOrders::test_result_value [32mPASSED[0m[32m [ 15%][0m | |
tests/test_average_per_customer.py::TestAveragePerCustomer::test_length_results [32mPASSED[0m[32m [ 23%][0m | |
tests/test_average_per_customer.py::TestAveragePerCustomer::test_results [32mPASSED[0m[32m [ 30%][0m | |
tests/test_average_per_customer.py::TestAveragePerCustomer::test_type_results [32mPASSED[0m[32m [ 38%][0m | |
tests/test_best_customers.py::TestBestCustomers::test_length_results [32mPASSED[0m[32m [ 46%][0m | |
tests/test_best_customers.py::TestBestCustomers::test_results [32mPASSED[0m[32m [ 53%][0m | |
tests/test_best_customers.py::TestBestCustomers::test_type_results [32mPASSED[0m[32m [ 61%][0m | |
tests/test_general_average.py::TestGeneralAverage::test_results [32mPASSED[0m[32m [ 69%][0m | |
tests/test_general_average.py::TestGeneralAverage::test_type_results [32mPASSED[0m[32m [ 76%][0m | |
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_length [32mPASSED[0m[32m [ 84%][0m | |
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_type [32mPASSED[0m[32m [ 92%][0m | |
tests/test_top_ordered_product_per_customer.py::TestTopOrderedProductPerCustomer::test_result_values [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m13 passed[0m[32m in 0.06s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/02-API | |
[1mcollecting ... [0mcollected 8 items | |
tests/test_history.py::TestHistory::test_daily_forecast_london_for_january_first_2019 [32mPASSED[0m[32m [ 12%][0m | |
tests/test_history.py::TestHistory::test_daily_forecast_paris_for_christmas_2015 [32mPASSED[0m[32m [ 25%][0m | |
tests/test_history.py::TestHistory::test_monthly_forecast_london_for_february_2019 [32mPASSED[0m[32m [ 37%][0m | |
tests/test_weather.py::TestWeather::test_search_city_ambiguous_city [32mPASSED[0m[32m [ 50%][0m | |
tests/test_weather.py::TestWeather::test_search_city_for_london [32mPASSED[0m[32m [ 62%][0m | |
tests/test_weather.py::TestWeather::test_search_city_for_paris [32mPASSED[0m[32m [ 75%][0m | |
tests/test_weather.py::TestWeather::test_search_city_for_unknown_city [32mPASSED[0m[32m [ 87%][0m | |
tests/test_weather.py::TestWeather::test_weather_forecast [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m8 passed[0m[32m in 17.79s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/03-Scraping | |
[1mcollecting ... [0mcollected 1 item | |
tests/test_recipe.py::TestRecipe::test_parse_carrot [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m1 passed[0m[32m in 0.20s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/02-Data-Sourcing/Optional-01-Olympic-Winter-Games | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_country_with_most_gold_medals_between_1994_and_1998 [32mPASSED[0m[32m [ 25%][0m | |
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_country_with_most_gold_medals_between_2002_and_2014 [32mPASSED[0m[32m [ 50%][0m | |
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_most_decorated_athlete_ever [32mPASSED[0m[32m [ 75%][0m | |
tests/test_winter_olympic_games.py::TestWinterOlympicGames::test_top_three_women_in_five_thousand_meters [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 0.12s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/05-SQL-Queries | |
[1mcollecting ... [0mcollected 18 items | |
tests/test_detailed_movies.py::TestDetailedMovies::test_first_element [32mPASSED[0m[32m [ 5%][0m | |
tests/test_detailed_movies.py::TestDetailedMovies::test_is_list [32mPASSED[0m[32m [ 11%][0m | |
tests/test_detailed_movies.py::TestDetailedMovies::test_len_each_tuple [32mPASSED[0m[32m [ 16%][0m | |
tests/test_detailed_movies.py::TestDetailedMovies::test_length_list [32mPASSED[0m[32m [ 22%][0m | |
tests/test_late_released_movies.py::TestLateReleasedMovies::test_first_element [32mPASSED[0m[32m [ 27%][0m | |
tests/test_late_released_movies.py::TestLateReleasedMovies::test_is_list [32mPASSED[0m[32m [ 33%][0m | |
tests/test_late_released_movies.py::TestLateReleasedMovies::test_length_list [32mPASSED[0m[32m [ 38%][0m | |
tests/test_movie_duration_buckets.py::TestMovieDurationBuckets::test_movie_duration_buckets [32mPASSED[0m[32m [ 44%][0m | |
tests/test_stats_on.py::TestStatsOn::test_is_dict [32mPASSED[0m[32m [ 50%][0m | |
tests/test_stats_on.py::TestStatsOn::test_results_for_action_adv [32mPASSED[0m[32m [ 55%][0m | |
tests/test_stats_on.py::TestStatsOn::test_results_for_drama [32mPASSED[0m[32m [ 61%][0m | |
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_5_results [32mPASSED[0m[32m [ 66%][0m | |
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_list [32mPASSED[0m[32m [ 72%][0m | |
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_right_results1 [32mPASSED[0m[32m [ 77%][0m | |
tests/test_top_five_directors_for.py::TestTopFiveDirectorsFor::test_return_right_results2 [32mPASSED[0m[32m [ 83%][0m | |
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_first_element [32mPASSED[0m[32m [ 88%][0m | |
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_is_list [32mPASSED[0m[32m [ 94%][0m | |
tests/test_top_five_youngest_newly_directors.py::TestTopFiveYoungestNewlyDirectors::test_length_list [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m18 passed[0m[32m in 0.17s[0m[32m ==============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/03-Interacting-with-db | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_user.py::Users::test_directors_should_have_the_correct_fields [31mFAILED[0m[31m [ 25%][0m | |
tests/test_user.py::Users::test_directors_table_exists [31mFAILED[0m[31m [ 50%][0m | |
tests/test_user.py::Users::test_movies_should_have_the_correct_fields [31mFAILED[0m[31m [ 75%][0m | |
tests/test_user.py::Users::test_movies_table_exists [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_____________ Users.test_directors_should_have_the_correct_fields ______________[0m | |
self = <tests.test_user.Users testMethod=test_directors_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_directors_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data= file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:46: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10755e730> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1072e04c0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m______________________ Users.test_directors_table_exists _______________________[0m | |
self = <tests.test_user.Users testMethod=test_directors_table_exists> | |
[94mdef[39;49;00m [92mtest_directors_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:35: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x107547610> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8d30> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m_______________ Users.test_movies_should_have_the_correct_fields _______________[0m | |
self = <tests.test_user.Users testMethod=test_movies_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_movies_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data= file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:23: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1075e87f0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8e50> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m________________________ Users.test_movies_table_exists ________________________[0m | |
self = <tests.test_user.Users testMethod=test_movies_table_exists> | |
[94mdef[39;49;00m [92mtest_movies_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:12: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10760ba60> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>INTEGER</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x1075a8f70> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
=========================== short test summary info ============================ | |
FAILED tests/test_user.py::Users::test_directors_should_have_the_correct_fields | |
FAILED tests/test_user.py::Users::test_directors_table_exists - bs4.FeatureNo... | |
FAILED tests/test_user.py::Users::test_movies_should_have_the_correct_fields | |
FAILED tests/test_user.py::Users::test_movies_table_exists - bs4.FeatureNotFo... | |
[31m============================== [31m[1m4 failed[0m[31m in 0.27s[0m[31m ===============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/02-DB-Design | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_user.py::Users::test_movies_should_have_the_correct_fields [31mFAILED[0m[31m [ 16%][0m | |
tests/test_user.py::Users::test_movies_table_exists [31mFAILED[0m[31m [ 33%][0m | |
tests/test_user.py::Users::test_users_should_have_the_correct_fields [31mFAILED[0m[31m [ 50%][0m | |
tests/test_user.py::Users::test_users_table_exists [31mFAILED[0m[31m [ 66%][0m | |
tests/test_user.py::Users::test_views_should_have_the_correct_fields [31mFAILED[0m[31m [ 83%][0m | |
tests/test_user.py::Users::test_views_table_exists [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_______________ Users.test_movies_should_have_the_correct_fields _______________[0m | |
self = <tests.test_user.Users testMethod=test_movies_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_movies_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:42: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e935fd0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e6ab550> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m________________________ Users.test_movies_table_exists ________________________[0m | |
self = <tests.test_user.Users testMethod=test_movies_table_exists> | |
[94mdef[39;49;00m [92mtest_movies_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:32: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e968c40> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e842310> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m_______________ Users.test_users_should_have_the_correct_fields ________________[0m | |
self = <tests.test_user.Users testMethod=test_users_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_users_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:21: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10ea1caf0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e9750d0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m________________________ Users.test_users_table_exists _________________________[0m | |
self = <tests.test_user.Users testMethod=test_users_table_exists> | |
[94mdef[39;49;00m [92mtest_users_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:11: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e9b8a90> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e975ca0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m_______________ Users.test_views_should_have_the_correct_fields ________________[0m | |
self = <tests.test_user.Users testMethod=test_views_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_views_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:63: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e968550> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e975af0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m________________________ Users.test_views_table_exists _________________________[0m | |
self = <tests.test_user.Users testMethod=test_views_table_exists> | |
[94mdef[39;49;00m [92mtest_views_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33mmovies.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:53: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x10e9d6ac0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...ULL</default><relation table="movies" row="id" /></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x10e9750d0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
=========================== short test summary info ============================ | |
FAILED tests/test_user.py::Users::test_movies_should_have_the_correct_fields | |
FAILED tests/test_user.py::Users::test_movies_table_exists - bs4.FeatureNotFo... | |
FAILED tests/test_user.py::Users::test_users_should_have_the_correct_fields | |
FAILED tests/test_user.py::Users::test_users_table_exists - bs4.FeatureNotFou... | |
FAILED tests/test_user.py::Users::test_views_should_have_the_correct_fields | |
FAILED tests/test_user.py::Users::test_views_table_exists - bs4.FeatureNotFou... | |
[31m============================== [31m[1m6 failed[0m[31m in 0.31s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module queries[0m | |
queries.py:27:0: C0301: [1mLine too long (110/100)[0m ([1mline-too-long[0m) | |
queries.py:52:0: C0301: [1mLine too long (109/100)[0m ([1mline-too-long[0m) | |
------------------------------------------------------------------- | |
Your code has been rated at 9.20/10 (previous run: 10.00/10, -0.80) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/04-Interacting-With-Code | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_user.py::QueriesMethods::test_directors_count [32mPASSED[0m[32m [ 16%][0m | |
tests/test_user.py::QueriesMethods::test_directors_list [32mPASSED[0m[32m [ 33%][0m | |
tests/test_user.py::QueriesMethods::test_directors_named_like_count [32mPASSED[0m[32m [ 50%][0m | |
tests/test_user.py::QueriesMethods::test_input_escaping [32mPASSED[0m[32m [ 66%][0m | |
tests/test_user.py::QueriesMethods::test_love_movies [32mPASSED[0m[32m [ 83%][0m | |
tests/test_user.py::QueriesMethods::test_movies_longer_than [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m6 passed[0m[32m in 0.39s[0m[32m ===============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/03-SQL-Basics/01-Table-Design | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_user.py::Users::test_should_have_the_correct_fields [31mFAILED[0m[31m [ 33%][0m | |
tests/test_user.py::Users::test_should_only_have_users_table [31mFAILED[0m[31m [ 66%][0m | |
tests/test_user.py::Users::test_users_table_exists [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m__________________ Users.test_should_have_the_correct_fields ___________________[0m | |
self = <tests.test_user.Users testMethod=test_should_have_the_correct_fields> | |
[94mdef[39;49;00m [92mtest_should_have_the_correct_fields[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33musers.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data= file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:23: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1053f5b20> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105178550> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m___________________ Users.test_should_only_have_users_table ____________________[0m | |
self = <tests.test_user.Users testMethod=test_should_only_have_users_table> | |
[94mdef[39;49;00m [92mtest_should_only_have_users_table[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33musers.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:17: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1054799d0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105316dc0> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
[31m[1m________________________ Users.test_users_table_exists _________________________[0m | |
self = <tests.test_user.Users testMethod=test_users_table_exists> | |
[94mdef[39;49;00m [92mtest_users_table_exists[39;49;00m([96mself[39;49;00m): | |
[94mwith[39;49;00m [96mopen[39;49;00m([33m'[39;49;00m[33musers.xml[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33mr[39;49;00m[33m'[39;49;00m) [94mas[39;49;00m file: | |
data = file.read().replace([33m'[39;49;00m[33m\n[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m'[39;49;00m) | |
> soup = BeautifulSoup(data, [33m'[39;49;00m[33mxml[39;49;00m[33m'[39;49;00m) | |
[1m[31mtests/test_user.py[0m:11: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <[AttributeError("'<class 'bs4.BeautifulSoup'>' object has no attribute 'contents'") raised in repr()] BeautifulSoup object at 0x1054f83d0> | |
markup = '<?xml version="1.0" encoding="utf-8" ?><!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesi...atatype>VARCHAR</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>' | |
features = ['xml'], builder = None, parse_only = None, from_encoding = None | |
exclude_encodings = None, element_classes = None, kwargs = {} | |
deprecated_argument = <function BeautifulSoup.__init__.<locals>.deprecated_argument at 0x105316d30> | |
original_builder = None, original_features = 'xml', builder_class = None | |
[94mdef[39;49;00m [92m__init__[39;49;00m([96mself[39;49;00m, markup=[33m"[39;49;00m[33m"[39;49;00m, features=[94mNone[39;49;00m, builder=[94mNone[39;49;00m, | |
parse_only=[94mNone[39;49;00m, from_encoding=[94mNone[39;49;00m, exclude_encodings=[94mNone[39;49;00m, | |
element_classes=[94mNone[39;49;00m, **kwargs): | |
[33m"""Constructor.[39;49;00m | |
[33m[39;49;00m | |
[33m :param markup: A string or a file-like object representing[39;49;00m | |
[33m markup to be parsed.[39;49;00m | |
[33m[39;49;00m | |
[33m :param features: Desirable features of the parser to be[39;49;00m | |
[33m used. This may be the name of a specific parser ("lxml",[39;49;00m | |
[33m "lxml-xml", "html.parser", or "html5lib") or it may be the[39;49;00m | |
[33m type of markup to be used ("html", "html5", "xml"). It's[39;49;00m | |
[33m recommended that you name a specific parser, so that[39;49;00m | |
[33m Beautiful Soup gives you the same results across platforms[39;49;00m | |
[33m and virtual environments.[39;49;00m | |
[33m[39;49;00m | |
[33m :param builder: A TreeBuilder subclass to instantiate (or[39;49;00m | |
[33m instance to use) instead of looking one up based on[39;49;00m | |
[33m `features`. You only need to use this if you've implemented a[39;49;00m | |
[33m custom TreeBuilder.[39;49;00m | |
[33m[39;49;00m | |
[33m :param parse_only: A SoupStrainer. Only parts of the document[39;49;00m | |
[33m matching the SoupStrainer will be considered. This is useful[39;49;00m | |
[33m when parsing part of a document that would otherwise be too[39;49;00m | |
[33m large to fit into memory.[39;49;00m | |
[33m[39;49;00m | |
[33m :param from_encoding: A string indicating the encoding of the[39;49;00m | |
[33m document to be parsed. Pass this in if Beautiful Soup is[39;49;00m | |
[33m guessing wrongly about the document's encoding.[39;49;00m | |
[33m[39;49;00m | |
[33m :param exclude_encodings: A list of strings indicating[39;49;00m | |
[33m encodings known to be wrong. Pass this in if you don't know[39;49;00m | |
[33m the document's encoding but you know Beautiful Soup's guess is[39;49;00m | |
[33m wrong.[39;49;00m | |
[33m[39;49;00m | |
[33m :param element_classes: A dictionary mapping BeautifulSoup[39;49;00m | |
[33m classes like Tag and NavigableString, to other classes you'd[39;49;00m | |
[33m like to be instantiated instead as the parse tree is[39;49;00m | |
[33m built. This is useful for subclassing Tag or NavigableString[39;49;00m | |
[33m to modify default behavior.[39;49;00m | |
[33m[39;49;00m | |
[33m :param kwargs: For backwards compatibility purposes, the[39;49;00m | |
[33m constructor accepts certain keyword arguments used in[39;49;00m | |
[33m Beautiful Soup 3. None of these arguments do anything in[39;49;00m | |
[33m Beautiful Soup 4; they will result in a warning and then be[39;49;00m | |
[33m ignored.[39;49;00m | |
[33m[39;49;00m | |
[33m Apart from this, any keyword arguments passed into the[39;49;00m | |
[33m BeautifulSoup constructor are propagated to the TreeBuilder[39;49;00m | |
[33m constructor. This makes it possible to configure a[39;49;00m | |
[33m TreeBuilder by passing in arguments, not just by saying which[39;49;00m | |
[33m one to use.[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m [33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mconvertEntities[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the convertEntities argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Entities are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mmarkupMassage[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the markupMassage argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor any necessary markup massage.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33msmartQuotesTo[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the smartQuotesTo argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Smart quotes are always converted [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mto Unicode characters.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33mselfClosingTags[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the selfClosingTags argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. The tree builder is responsible [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfor understanding self-closing tags.[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m [33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m [95min[39;49;00m kwargs: | |
[94mdel[39;49;00m kwargs[[33m'[39;49;00m[33misHTML[39;49;00m[33m'[39;49;00m] | |
warnings.warn( | |
[33m"[39;49;00m[33mBS4 does not respect the isHTML argument to the [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mBeautifulSoup constructor. Suggest you use [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mfeatures=[39;49;00m[33m'[39;49;00m[33mlxml[39;49;00m[33m'[39;49;00m[33m for HTML and features=[39;49;00m[33m'[39;49;00m[33mlxml-xml[39;49;00m[33m'[39;49;00m[33m for [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mXML.[39;49;00m[33m"[39;49;00m) | |
[94mdef[39;49;00m [92mdeprecated_argument[39;49;00m(old_name, new_name): | |
[94mif[39;49;00m old_name [95min[39;49;00m kwargs: | |
warnings.warn( | |
[33m'[39;49;00m[33mThe [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m"[39;49;00m[33m argument to the BeautifulSoup constructor [39;49;00m[33m'[39;49;00m | |
[33m'[39;49;00m[33mhas been renamed to [39;49;00m[33m"[39;49;00m[33m%s[39;49;00m[33m.[39;49;00m[33m"[39;49;00m[33m'[39;49;00m % (old_name, new_name)) | |
value = kwargs[old_name] | |
[94mdel[39;49;00m kwargs[old_name] | |
[94mreturn[39;49;00m value | |
[94mreturn[39;49;00m [94mNone[39;49;00m | |
parse_only = parse_only [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mparseOnlyThese[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mparse_only[39;49;00m[33m"[39;49;00m) | |
from_encoding = from_encoding [95mor[39;49;00m deprecated_argument( | |
[33m"[39;49;00m[33mfromEncoding[39;49;00m[33m"[39;49;00m, [33m"[39;49;00m[33mfrom_encoding[39;49;00m[33m"[39;49;00m) | |
[94mif[39;49;00m from_encoding [95mand[39;49;00m [96misinstance[39;49;00m(markup, [96mstr[39;49;00m): | |
warnings.warn([33m"[39;49;00m[33mYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.[39;49;00m[33m"[39;49;00m) | |
from_encoding = [94mNone[39;49;00m | |
[96mself[39;49;00m.element_classes = element_classes [95mor[39;49;00m [96mdict[39;49;00m() | |
[90m# We need this information to track whether or not the builder[39;49;00m | |
[90m# was specified well enough that we can omit the 'you need to[39;49;00m | |
[90m# specify a parser' warning.[39;49;00m | |
original_builder = builder | |
original_features = features | |
[94mif[39;49;00m [96misinstance[39;49;00m(builder, [96mtype[39;49;00m): | |
[90m# A builder class was passed in; it needs to be instantiated.[39;49;00m | |
builder_class = builder | |
builder = [94mNone[39;49;00m | |
[94melif[39;49;00m builder [95mis[39;49;00m [94mNone[39;49;00m: | |
[94mif[39;49;00m [96misinstance[39;49;00m(features, [96mstr[39;49;00m): | |
features = [features] | |
[94mif[39;49;00m features [95mis[39;49;00m [94mNone[39;49;00m [95mor[39;49;00m [96mlen[39;49;00m(features) == [94m0[39;49;00m: | |
features = [96mself[39;49;00m.DEFAULT_BUILDER_FEATURES | |
builder_class = builder_registry.lookup(*features) | |
[94mif[39;49;00m builder_class [95mis[39;49;00m [94mNone[39;49;00m: | |
> [94mraise[39;49;00m FeatureNotFound( | |
[33m"[39;49;00m[33mCouldn[39;49;00m[33m'[39;49;00m[33mt find a tree builder with the features you [39;49;00m[33m"[39;49;00m | |
[33m"[39;49;00m[33mrequested: [39;49;00m[33m%s[39;49;00m[33m. Do you need to install a parser library?[39;49;00m[33m"[39;49;00m | |
% [33m"[39;49;00m[33m,[39;49;00m[33m"[39;49;00m.join(features)) | |
[1m[31mE bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/bs4/__init__.py[0m:243: FeatureNotFound | |
=========================== short test summary info ============================ | |
FAILED tests/test_user.py::Users::test_should_have_the_correct_fields - bs4.F... | |
FAILED tests/test_user.py::Users::test_should_only_have_users_table - bs4.Fea... | |
FAILED tests/test_user.py::Users::test_users_table_exists - bs4.FeatureNotFou... | |
[31m============================== [31m[1m3 failed[0m[31m in 0.24s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module calc[0m | |
calc.py:69:0: C0305: [1mTrailing newlines[0m ([1mtrailing-newlines[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 9.66/10 (previous run: 9.66/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/02-System-Parameters | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_calc.py::TestCalc::test_2_times_6 [32mPASSED[0m[32m [ 33%][0m | |
tests/test_calc.py::TestCalc::test_3_minus_9 [32mPASSED[0m[32m [ 66%][0m | |
tests/test_calc.py::TestCalc::test_4_plus_5 [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module currencies[0m | |
currencies.py:12:0: R1710: [1;3;35mEither all return statements in a function should return an expression, or none of them should.[0m ([1;3;35minconsistent-return-statements[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 8.57/10 (previous run: 8.57/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/06-Data-Structures | |
[1mcollecting ... [0mcollected 5 items | |
tests/test_currencies.py::TestStrings::test_convert_chf_to_eur [32mPASSED[0m[32m [ 20%][0m | |
tests/test_currencies.py::TestStrings::test_convert_eur_to_gbp [32mPASSED[0m[32m [ 40%][0m | |
tests/test_currencies.py::TestStrings::test_convert_gbp_to_eur [32mPASSED[0m[32m [ 60%][0m | |
tests/test_currencies.py::TestStrings::test_convert_usd_to_eur [32mPASSED[0m[32m [ 80%][0m | |
tests/test_currencies.py::TestStrings::test_should_handle_a_missing_rate [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m5 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/05-String-Manipulation | |
[1mcollecting ... [0mcollected 15 items | |
tests/test_string_methods.py::TestStrings::test_casanova_to_cosonovo [32mPASSED[0m[32m [ 6%][0m | |
tests/test_string_methods.py::TestStrings::test_do_not_include_word [32mPASSED[0m[32m [ 13%][0m | |
tests/test_string_methods.py::TestStrings::test_include_word [32mPASSED[0m[32m [ 20%][0m | |
tests/test_string_methods.py::TestStrings::test_is_a_question [32mPASSED[0m[32m [ 26%][0m | |
tests/test_string_methods.py::TestStrings::test_is_not_a_question [32mPASSED[0m[32m [ 33%][0m | |
tests/test_string_methods.py::TestStrings::test_john_doe_33_concatenation [32mPASSED[0m[32m [ 40%][0m | |
tests/test_string_methods.py::TestStrings::test_john_doe_33_formatting [32mPASSED[0m[32m [ 46%][0m | |
tests/test_string_methods.py::TestStrings::test_kosovo_to_kasava [32mPASSED[0m[32m [ 53%][0m | |
tests/test_string_methods.py::TestStrings::test_leading_whitespaces [32mPASSED[0m[32m [ 60%][0m | |
tests/test_string_methods.py::TestStrings::test_numbers_0_0_1_2_0_on_0 [32mPASSED[0m[32m [ 66%][0m | |
tests/test_string_methods.py::TestStrings::test_numbers_0_0_1_2_0_on_3 [32mPASSED[0m[32m [ 73%][0m | |
tests/test_string_methods.py::TestStrings::test_strings_boris_romain_seb [32mPASSED[0m[32m [ 80%][0m | |
tests/test_string_methods.py::TestStrings::test_strings_boris_seb_romain [32mPASSED[0m[32m [ 86%][0m | |
tests/test_string_methods.py::TestStrings::test_trailing_whitespaces [32mPASSED[0m[32m [ 93%][0m | |
tests/test_string_methods.py::TestStrings::test_whitespaces [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m15 passed[0m[32m in 0.06s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/01-Sum-Of-Three | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_sum_of_three.py::TestSumOfThree::test_numbers_0_0_0 [32mPASSED[0m[32m [ 33%][0m | |
tests/test_sum_of_three.py::TestSumOfThree::test_numbers_1_2_3 [32mPASSED[0m[32m [ 66%][0m | |
tests/test_sum_of_three.py::TestSumOfThree::test_with_negative_numbers [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.03s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module flask_option[0m | |
flask_option.py:8:0: W0311: [35mBad indentation. Found 6 spaces, expected 8[0m ([35mbad-indentation[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 8.75/10 (previous run: 8.75/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/03-Environment | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_flask_option.py::TestFlaskOption::test_start_with_flask_env_development [32mPASSED[0m[32m [ 33%][0m | |
tests/test_flask_option.py::TestFlaskOption::test_start_with_flask_env_production [32mPASSED[0m[32m [ 66%][0m | |
tests/test_flask_option.py::TestFlaskOption::test_start_with_no_flask_env [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.04s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/08-Optional-Sudoku-Solver | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid [32mPASSED[0m[32m [ 25%][0m | |
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid_2 [32mPASSED[0m[32m [ 50%][0m | |
tests/test_sudoku.py::SudokuSolverTest::test_incorrect_grid_3 [32mPASSED[0m[32m [ 75%][0m | |
tests/test_sudoku.py::SudokuSolverTest::test_valid_grid [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 0.05s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/07-Optional-Sudoku | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid [32mPASSED[0m[32m [ 25%][0m | |
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid2 [32mPASSED[0m[32m [ 50%][0m | |
tests/test_sudoku.py::SudokuValidatorTest::test_invalid_grid_column [32mPASSED[0m[32m [ 75%][0m | |
tests/test_sudoku.py::SudokuValidatorTest::test_valid_grid [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 0.05s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
-------------------------------------------------------------------- | |
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/01-Python/01-Programming-Basics/04-Debugging | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_hello.py::TestHello::test_empty_arguments [32mPASSED[0m[32m [ 25%][0m | |
tests/test_hello.py::TestHello::test_happy_path [32mPASSED[0m[32m [ 50%][0m | |
tests/test_hello.py::TestHello::test_only_first_name [32mPASSED[0m[32m [ 75%][0m | |
tests/test_hello.py::TestHello::test_only_last_name [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m4 passed[0m[32m in 0.05s[0m[32m ===============================[0m | |
Requirement already satisfied: streamlit in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (0.74.1) | |
Requirement already satisfied: numpy in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.19.5) | |
Requirement already satisfied: astor in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.8.1) | |
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.25.1) | |
Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (7.1.2) | |
Requirement already satisfied: toml in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.10.2) | |
Requirement already satisfied: cachetools>=4.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (4.2.0) | |
Requirement already satisfied: protobuf!=3.11,>=3.6.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (3.14.0) | |
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.8.1) | |
Requirement already satisfied: tornado>=5.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (6.1) | |
Requirement already satisfied: base58 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.1.0) | |
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (8.1.0) | |
Requirement already satisfied: gitpython in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (3.1.12) | |
Requirement already satisfied: altair>=3.2.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (4.1.0) | |
Requirement already satisfied: packaging in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (20.8) | |
Requirement already satisfied: validators in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.18.2) | |
Requirement already satisfied: tzlocal in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (2.1) | |
Requirement already satisfied: pandas>=0.21.0 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.2.0) | |
Requirement already satisfied: blinker in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (1.4) | |
Requirement already satisfied: pydeck>=0.1.dev5 in /usr/local/lib/python3.9/site-packages (from streamlit->-r requirements.txt (line 1)) (0.5.0) | |
Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (2.11.2) | |
Requirement already satisfied: jsonschema in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (3.2.0) | |
Requirement already satisfied: toolz in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.11.1) | |
Requirement already satisfied: entrypoints in /usr/local/lib/python3.9/site-packages (from altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.3) | |
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas>=0.21.0->streamlit->-r requirements.txt (line 1)) (2020.5) | |
Requirement already satisfied: six>=1.9 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from protobuf!=3.11,>=3.6.0->streamlit->-r requirements.txt (line 1)) (1.15.0) | |
Requirement already satisfied: traitlets>=4.3.2 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.0.5) | |
Requirement already satisfied: ipywidgets>=7.0.0 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (7.6.3) | |
Requirement already satisfied: ipykernel>=5.1.2 in /usr/local/lib/python3.9/site-packages (from pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.4.3) | |
Requirement already satisfied: appnope in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.1.2) | |
Requirement already satisfied: jupyter-client in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.1.11) | |
Requirement already satisfied: ipython>=5.0.0 in /usr/local/lib/python3.9/site-packages (from ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (7.19.0) | |
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (51.3.3) | |
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.0.10) | |
Requirement already satisfied: pygments in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (2.7.4) | |
Requirement already satisfied: backcall in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.0) | |
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.8.0) | |
Requirement already satisfied: decorator in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.4.2) | |
Requirement already satisfied: pickleshare in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.7.5) | |
Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.9/site-packages (from ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.18.0) | |
Requirement already satisfied: widgetsnbextension~=3.5.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.5.1) | |
Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.0.0) | |
Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.9/site-packages (from ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (5.1.2) | |
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.9/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.8.1) | |
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.9/site-packages (from jinja2->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (1.1.1) | |
Requirement already satisfied: jupyter-core in /usr/local/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (4.7.0) | |
Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.0) | |
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.9/site-packages (from jsonschema->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (0.17.3) | |
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.9/site-packages (from jsonschema->altair>=3.2.0->streamlit->-r requirements.txt (line 1)) (20.3.0) | |
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.9/site-packages (from pexpect>4.3->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.7.0) | |
Requirement already satisfied: wcwidth in /usr/local/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=5.0.0->ipykernel>=5.1.2->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.2.5) | |
Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.9/site-packages (from widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.2.0) | |
Requirement already satisfied: prometheus-client in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.9.0) | |
Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.9.2) | |
Requirement already satisfied: nbconvert in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (6.0.7) | |
Requirement already satisfied: pyzmq>=17 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (21.0.1) | |
Requirement already satisfied: Send2Trash>=1.5.0 in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.5.0) | |
Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (20.1.0) | |
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.9/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.14.4) | |
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/site-packages (from cffi>=1.0.0->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (2.20) | |
Requirement already satisfied: gitdb<5,>=4.0.1 in /usr/local/lib/python3.9/site-packages (from gitpython->streamlit->-r requirements.txt (line 1)) (4.0.5) | |
Requirement already satisfied: smmap<4,>=3.0.1 in /usr/local/lib/python3.9/site-packages (from gitdb<5,>=4.0.1->gitpython->streamlit->-r requirements.txt (line 1)) (3.0.4) | |
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.5.1) | |
Requirement already satisfied: testpath in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.4.4) | |
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.8.4) | |
Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.1.2) | |
Requirement already satisfied: bleach in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (3.2.1) | |
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.4.3) | |
Requirement already satisfied: defusedxml in /usr/local/lib/python3.9/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.6.0) | |
Requirement already satisfied: nest-asyncio in /usr/local/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.4.3) | |
Requirement already satisfied: async-generator in /usr/local/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (1.10) | |
Requirement already satisfied: webencodings in /usr/local/lib/python3.9/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit->-r requirements.txt (line 1)) (0.5.1) | |
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.9/site-packages (from packaging->streamlit->-r requirements.txt (line 1)) (2.4.7) | |
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (2020.12.5) | |
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (2.10) | |
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (1.26.2) | |
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.9/site-packages (from requests->streamlit->-r requirements.txt (line 1)) (4.0.0) | |
Requirement already satisfied: pytz in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (2020.5) | |
Collecting category_encoders==2.2.2 | |
Using cached category_encoders-2.2.2-py2.py3-none-any.whl (80 kB) | |
Collecting flask==1.1.1 | |
Using cached Flask-1.1.1-py2.py3-none-any.whl (94 kB) | |
Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.9/site-packages (from flask==1.1.1->-r requirements.txt (line 16)) (7.1.2) | |
Requirement already satisfied: Jinja2>=2.10.1 in /usr/local/lib/python3.9/site-packages (from flask==1.1.1->-r requirements.txt (line 16)) (2.11.2) | |
Collecting gcsfs==0.6.0 | |
Using cached gcsfs-0.6.0-py2.py3-none-any.whl (17 kB) | |
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (from gcsfs==0.6.0->-r requirements.txt (line 2)) (2.25.1) | |
Requirement already satisfied: decorator in /usr/local/lib/python3.9/site-packages (from gcsfs==0.6.0->-r requirements.txt (line 2)) (4.4.2) | |
Collecting google-cloud-storage==1.26.0 | |
Using cached google_cloud_storage-1.26.0-py2.py3-none-any.whl (75 kB) | |
Collecting joblib==0.14.1 | |
Using cached joblib-0.14.1-py2.py3-none-any.whl (294 kB) | |
Collecting memoized-property==1.0.3 | |
Using cached memoized-property-1.0.3.tar.gz (5.0 kB) | |
Collecting mlflow==1.8.0 | |
Using cached mlflow-1.8.0-py3-none-any.whl (10.4 MB) | |
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (2.8.1) | |
Requirement already satisfied: entrypoints in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (0.3) | |
Requirement already satisfied: protobuf>=3.6.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (3.14.0) | |
Requirement already satisfied: pyyaml in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (5.3.1) | |
Requirement already satisfied: six>=1.10.0 in /usr/local/Cellar/protobuf/3.14.0/libexec/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (1.15.0) | |
Requirement already satisfied: gitpython>=2.1.0 in /usr/local/lib/python3.9/site-packages (from mlflow==1.8.0->-r requirements.txt (line 6)) (3.1.12) | |
Collecting numpy==1.18.4 | |
Using cached numpy-1.18.4.zip (5.4 MB) | |
Installing build dependencies: started | |
Installing build dependencies: finished with status 'done' | |
Getting requirements to build wheel: started | |
Getting requirements to build wheel: finished with status 'done' | |
Preparing wheel metadata: started | |
Preparing wheel metadata: finished with status 'error' | |
gcloud ai-platform jobs submit training taxi_fare_model_20210119_160827 \ | |
--job-dir gs://wagon-ml/trainings \ | |
--package-path trainer \ | |
--module-name trainer.task \ | |
--python-version=3.5 \ | |
--runtime-version=1.14 \ | |
--region europe-west1 | |
gcloud ai-platform jobs submit training taxi_fare_model_training_20210119_160827 \ | |
--job-dir gs://taxi-fare-model-999/trainings \ | |
--package-path TaxiFareModel \ | |
--module-name TaxiFareModel.trainer \ | |
--python-version=3.5 \ | |
--runtime-version=1.14 \ | |
--region europe-west1 | |
gcloud ai-platform jobs submit training taxi_fare_model_20210119_160829 \ | |
--job-dir gs://wagon-ml/trainings \ | |
--package-path trainer \ | |
--module-name trainer.task \ | |
--python-version=3.5 \ | |
--runtime-version=1.14 \ | |
--region europe-west1 | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module pythagore[0m | |
pythagore.py:10:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
pythagore.py:10:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module euclidean_distance_2d[0m | |
euclidean_distance_2d.py:11:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_2d.py:11:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
euclidean_distance_2d.py:25:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_2d.py:25:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
euclidean_distance_2d.py:37:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_2d.py:37:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
euclidean_distance_2d.py:45:4: C0200: [1mConsider using enumerate instead of iterating with range and len[0m ([1mconsider-using-enumerate[0m) | |
euclidean_distance_2d.py:48:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_2d.py:48:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
euclidean_distance_2d.py:63:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_2d.py:63:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module euclidean_distance_3d[0m | |
euclidean_distance_3d.py:22:0: C0305: [1mTrailing newlines[0m ([1mtrailing-newlines[0m) | |
euclidean_distance_3d.py:10:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_3d.py:10:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
euclidean_distance_3d.py:21:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_3d.py:21:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module euclidean_distance_nd[0m | |
euclidean_distance_nd.py:15:0: C0305: [1mTrailing newlines[0m ([1mtrailing-newlines[0m) | |
euclidean_distance_nd.py:14:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
euclidean_distance_nd.py:14:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 6.82/10 (previous run: 6.82/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/Hidden-euclidean-distance | |
[1mcollecting ... [0mcollected 23 items | |
tests/test_distance_3d.py::TestDistance3D::test_points_in_sphere [31mFAILED[0m[31m [ 4%][0m | |
tests/test_distance_3d.py::TestDistance3D::test_result_1 [32mPASSED[0m[31m [ 8%][0m | |
tests/test_distance_3d.py::TestDistance3D::test_same_point [32mPASSED[0m[31m [ 13%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_error_result [32mPASSED[0m[31m [ 17%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_result [32mPASSED[0m[31m [ 21%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_same_line [32mPASSED[0m[31m [ 26%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_hypotenuse_same_point [32mPASSED[0m[31m [ 30%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_negative_value [32mPASSED[0m[31m [ 34%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_no_error [32mPASSED[0m[31m [ 39%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_origine [32mPASSED[0m[31m [ 43%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_test1 [32mPASSED[0m[31m [ 47%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_test2 [32mPASSED[0m[31m [ 52%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_p2d_zero [32mPASSED[0m[31m [ 56%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_points_in_circle [32mPASSED[0m[31m [ 60%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_same_point [32mPASSED[0m[31m [ 65%][0m | |
tests/test_euclidean_dist_2d.py::TestEuclideanDistance2D::test_x_axis [32mPASSED[0m[31m [ 69%][0m | |
tests/test_euclidean_distance_nd.py::TestDistanceND::test_100d_pointst [32mPASSED[0m[31m [ 73%][0m | |
tests/test_euclidean_distance_nd.py::TestDistanceND::test_10d_pointst [32mPASSED[0m[31m [ 78%][0m | |
tests/test_euclidean_distance_nd.py::TestDistanceND::test_same_point [32mPASSED[0m[31m [ 82%][0m | |
tests/test_pythagore.py::TestDebugMatrix::test_negative_value [32mPASSED[0m[31m [ 86%][0m | |
tests/test_pythagore.py::TestDebugMatrix::test_result [32mPASSED[0m[31m [ 91%][0m | |
tests/test_pythagore.py::TestDebugMatrix::test_string_value [32mPASSED[0m[31m [ 95%][0m | |
tests/test_pythagore.py::TestDebugMatrix::test_zero_value [32mPASSED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_____________________ TestDistance3D.test_points_in_sphere _____________________[0m | |
self = <tests.test_distance_3d.TestDistance3D testMethod=test_points_in_sphere> | |
[94mdef[39;49;00m [92mtest_points_in_sphere[39;49;00m([96mself[39;49;00m): | |
random.seed([94m1[39;49;00m) | |
R = [94m4[39;49;00m | |
X = [] | |
C = ([94m0[39;49;00m, [94m0[39;49;00m, [94m0[39;49;00m) | |
[94mfor[39;49;00m i [95min[39;49;00m [96mrange[39;49;00m([94m100[39;49;00m): | |
x = [96mround[39;49;00m(random.uniform(-R, R), [94m2[39;49;00m) | |
y = [96mround[39;49;00m(random.uniform(-R, R), [94m2[39;49;00m) | |
z = [96mround[39;49;00m(random.uniform(-R, R), [94m2[39;49;00m) | |
X.append([x, y, z]) | |
results = points_in_sphere(X, C, R) | |
expected = [[-[94m1.96[39;49;00m, -[94m0.04[39;49;00m, -[94m0.4[39;49;00m], [[94m0.33[39;49;00m, [94m3.51[39;49;00m, -[94m0.95[39;49;00m], [-[94m2.23[39;49;00m, -[94m0.5[39;49;00m, -[94m0.03[39;49;00m], [-[94m2.14[39;49;00m, -[94m2.15[39;49;00m, -[94m2.25[39;49;00m]] | |
fig = plt.figure() | |
ax = Axes3D(fig) | |
> ax.set_aspect([33m"[39;49;00m[33mequal[39;49;00m[33m"[39;49;00m) | |
[1m[31mtests/test_distance_3d.py[0m:43: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <mpl_toolkits.mplot3d.axes3d.Axes3D object at 0x10c2047c0> | |
aspect = 'equal', adjustable = None, anchor = None, share = False | |
[94mdef[39;49;00m [92mset_aspect[39;49;00m([96mself[39;49;00m, aspect, adjustable=[94mNone[39;49;00m, anchor=[94mNone[39;49;00m, share=[94mFalse[39;49;00m): | |
[33m"""[39;49;00m | |
[33m Set the aspect ratios.[39;49;00m | |
[33m[39;49;00m | |
[33m Axes 3D does not current support any aspect but 'auto' which fills[39;49;00m | |
[33m the axes with the data limits.[39;49;00m | |
[33m[39;49;00m | |
[33m To simulate having equal aspect in data space, set the ratio[39;49;00m | |
[33m of your data limits to match the value of `~.get_box_aspect`.[39;49;00m | |
[33m To control box aspect ratios use `~.Axes3D.set_box_aspect`.[39;49;00m | |
[33m[39;49;00m | |
[33m Parameters[39;49;00m | |
[33m ----------[39;49;00m | |
[33m aspect : {'auto'}[39;49;00m | |
[33m Possible values:[39;49;00m | |
[33m[39;49;00m | |
[33m ========= ==================================================[39;49;00m | |
[33m value description[39;49;00m | |
[33m ========= ==================================================[39;49;00m | |
[33m 'auto' automatic; fill the position rectangle with data.[39;49;00m | |
[33m ========= ==================================================[39;49;00m | |
[33m[39;49;00m | |
[33m adjustable : None[39;49;00m | |
[33m Currently ignored by Axes3D[39;49;00m | |
[33m[39;49;00m | |
[33m If not *None*, this defines which parameter will be adjusted to[39;49;00m | |
[33m meet the required aspect. See `.set_adjustable` for further[39;49;00m | |
[33m details.[39;49;00m | |
[33m[39;49;00m | |
[33m anchor : None or str or 2-tuple of float, optional[39;49;00m | |
[33m If not *None*, this defines where the Axes will be drawn if there[39;49;00m | |
[33m is extra space due to aspect constraints. The most common way to[39;49;00m | |
[33m to specify the anchor are abbreviations of cardinal directions:[39;49;00m | |
[33m[39;49;00m | |
[33m ===== =====================[39;49;00m | |
[33m value description[39;49;00m | |
[33m ===== =====================[39;49;00m | |
[33m 'C' centered[39;49;00m | |
[33m 'SW' lower left corner[39;49;00m | |
[33m 'S' middle of bottom edge[39;49;00m | |
[33m 'SE' lower right corner[39;49;00m | |
[33m etc.[39;49;00m | |
[33m ===== =====================[39;49;00m | |
[33m[39;49;00m | |
[33m See `.set_anchor` for further details.[39;49;00m | |
[33m[39;49;00m | |
[33m share : bool, default: False[39;49;00m | |
[33m If ``True``, apply the settings to all shared Axes.[39;49;00m | |
[33m[39;49;00m | |
[33m See Also[39;49;00m | |
[33m --------[39;49;00m | |
[33m mpl_toolkits.mplot3d.axes3d.Axes3D.set_box_aspect[39;49;00m | |
[33m """[39;49;00m | |
[94mif[39;49;00m aspect != [33m'[39;49;00m[33mauto[39;49;00m[33m'[39;49;00m: | |
> [94mraise[39;49;00m [96mNotImplementedError[39;49;00m( | |
[33m"[39;49;00m[33mAxes3D currently only supports the aspect argument [39;49;00m[33m"[39;49;00m | |
[33mf[39;49;00m[33m"[39;49;00m[33m'[39;49;00m[33mauto[39;49;00m[33m'[39;49;00m[33m. You passed in [39;49;00m[33m{[39;49;00maspect[33m!r}[39;49;00m[33m.[39;49;00m[33m"[39;49;00m | |
) | |
[1m[31mE NotImplementedError: Axes3D currently only supports the aspect argument 'auto'. You passed in 'equal'.[0m | |
[1m[31m/usr/local/lib/python3.9/site-packages/mpl_toolkits/mplot3d/axes3d.py[0m:323: NotImplementedError | |
=========================== short test summary info ============================ | |
FAILED tests/test_distance_3d.py::TestDistance3D::test_points_in_sphere - Not... | |
[31m=================== [31m[1m1 failed[0m, [32m22 passed[0m[31m in 65.53s (0:01:05)[0m[31m ====================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module basic_functions[0m | |
basic_functions.py:6:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
basic_functions.py:6:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
basic_functions.py:13:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
basic_functions.py:13:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
basic_functions.py:41:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
basic_functions.py:41:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module addition[0m | |
addition.py:20:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
addition.py:20:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module transpose[0m | |
transpose.py:8:4: C0103: [1mVariable name "N" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
transpose.py:8:7: C0103: [1mVariable name "M" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
transpose.py:9:4: C0103: [1mVariable name "B" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
transpose.py:14:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
transpose.py:14:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
transpose.py:3:0: W0611: [35mUnused print_matrix imported from basic_functions[0m ([35munused-import[0m) | |
[7;33m************* Module product[0m | |
product.py:23:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
product.py:23:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 7.71/10 (previous run: 5.56/10, +2.16) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/Hidden-linear-algebra | |
[1mcollecting ... [0mcollected 18 items | |
tests/test_addition.py::TestDebugMatrix::test_result [32mPASSED[0m[32m [ 5%][0m | |
tests/test_addition.py::TestDebugMatrix::test_size_error [32mPASSED[0m[32m [ 11%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_M_00 [32mPASSED[0m[32m [ 16%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_M_12 [32mPASSED[0m[32m [ 22%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_M_ij_out_of_range [32mPASSED[0m[32m [ 27%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_add_one2M [32mPASSED[0m[32m [ 33%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_double_zeros [32mPASSED[0m[32m [ 38%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_get_column [32mPASSED[0m[32m [ 44%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_get_column_out_of_range [32mPASSED[0m[32m [ 50%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_multiply_M [32mPASSED[0m[32m [ 55%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_size_11 [32mPASSED[0m[32m [ 61%][0m | |
tests/test_basic_functions.py::TestDebugMatrix::test_size_M [32mPASSED[0m[32m [ 66%][0m | |
tests/test_multiplication.py::TestDebugMatrix::test_result [32mPASSED[0m[32m [ 72%][0m | |
tests/test_multiplication.py::TestDebugMatrix::test_size_error [32mPASSED[0m[32m [ 77%][0m | |
tests/test_transpose.py::TestTranspose::test_non_square_matrix [32mPASSED[0m[32m [ 83%][0m | |
tests/test_transpose.py::TestTranspose::test_square_matrix [32mPASSED[0m[32m [ 88%][0m | |
tests/test_transpose.py::TestTranspose::test_transpose_col [32mPASSED[0m[32m [ 94%][0m | |
tests/test_transpose.py::TestTranspose::test_transpose_row [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m18 passed[0m[32m in 0.11s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/03-Scipy | |
[1mcollecting ... [0mcollected 13 items | |
tests/test_global_optimization.py::TestGlobalOptimization::test_bounds_values [32mPASSED[0m[32m [ 7%][0m | |
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_dual_shape [32mPASSED[0m[32m [ 15%][0m | |
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_dual_values [32mPASSED[0m[32m [ 23%][0m | |
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_shgo_shape [32mPASSED[0m[32m [ 30%][0m | |
tests/test_global_optimization.py::TestGlobalOptimization::test_minimum_shgo_values [32mPASSED[0m[32m [ 38%][0m | |
tests/test_minimize2d.py::TestMinimize2d::test_minimum_shape [32mPASSED[0m[32m [ 46%][0m | |
tests/test_minimize2d.py::TestMinimize2d::test_starting_point_shape [32mPASSED[0m[32m [ 53%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_bounds_values [32mPASSED[0m[32m [ 61%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_first_constraint [32mPASSED[0m[32m [ 69%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_minimum_shape [32mPASSED[0m[32m [ 76%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_second_constraint [32mPASSED[0m[32m [ 84%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_starting_point_shape [32mPASSED[0m[32m [ 92%][0m | |
tests/test_minimize_constraints.py::TestMinimizeConstraints::test_third_constraint [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m13 passed[0m[32m in 0.26s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/01-real-estate-estimator | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_features.py::TestFeatures::test_X_shape [32mPASSED[0m[32m [ 16%][0m | |
tests/test_features.py::TestFeatures::test_features_order [32mPASSED[0m[32m [ 33%][0m | |
tests/test_features.py::TestFeatures::test_x0_is_ones [32mPASSED[0m[32m [ 50%][0m | |
tests/test_solution.py::TestSolution::test_theta0_is_positive [32mPASSED[0m[32m [ 66%][0m | |
tests/test_solution.py::TestSolution::test_theta_shape [32mPASSED[0m[32m [ 83%][0m | |
tests/test_target.py::TestTarget::test_shape [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m6 passed[0m[32m in 0.15s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/01-Algebra-Calculus/02-real-estate-advanced-estimator | |
[1mcollecting ... [0mcollected 6 items | |
tests/test_flats.py::TestFlats::test_columns [32mPASSED[0m[32m [ 16%][0m | |
tests/test_flats.py::TestFlats::test_shape [32mPASSED[0m[32m [ 33%][0m | |
tests/test_univariate.py::TestUnivariate::test_best_intercept [32mPASSED[0m[32m [ 50%][0m | |
tests/test_univariate.py::TestUnivariate::test_best_slope [32mPASSED[0m[32m [ 66%][0m | |
tests/test_univariate.py::TestUnivariate::test_mse [32mPASSED[0m[32m [ 83%][0m | |
tests/test_univariate.py::TestUnivariate::test_squared_errors [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m6 passed[0m[32m in 0.56s[0m[32m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module basic_functions[0m | |
basic_functions.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
basic_functions.py:1:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions.py:1:12: W0613: [35mUnused argument 'samples'[0m ([35munused-argument[0m) | |
basic_functions.py:5:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions.py:5:26: W0613: [35mUnused argument 'samples'[0m ([35munused-argument[0m) | |
basic_functions.py:9:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions.py:9:14: W0613: [35mUnused argument 'samples'[0m ([35munused-argument[0m) | |
basic_functions.py:13:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions.py:13:12: W0613: [35mUnused argument 'samples'[0m ([35munused-argument[0m) | |
[7;33m************* Module basic_functions_solution[0m | |
basic_functions_solution.py:5:0: C0325: [1mUnnecessary parens after 'return' keyword[0m ([1msuperfluous-parens[0m) | |
basic_functions_solution.py:1:0: C0114: [1mMissing module docstring[0m ([1mmissing-module-docstring[0m) | |
basic_functions_solution.py:1:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions_solution.py:2:4: C0103: [1mVariable name "mu" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
basic_functions_solution.py:4:8: C0103: [1mVariable name "mu" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
basic_functions_solution.py:8:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions_solution.py:10:4: C0103: [1mVariable name "mu" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
basic_functions_solution.py:16:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
basic_functions_solution.py:28:0: C0116: [1mMissing function or method docstring[0m ([1mmissing-function-docstring[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 4.71/10 (previous run: 4.71/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/01-Mean-Mode-Median-Std | |
[1mcollecting ... [0mcollected 4 items | |
tests/test_basic_functions.py::TestBasicFunctions::test_my_mean [31mFAILED[0m[31m [ 25%][0m | |
tests/test_basic_functions.py::TestBasicFunctions::test_my_median [31mFAILED[0m[31m [ 50%][0m | |
tests/test_basic_functions.py::TestBasicFunctions::test_my_mode [31mFAILED[0m[31m [ 75%][0m | |
tests/test_basic_functions.py::TestBasicFunctions::test_my_standard_deviation [31mFAILED[0m[31m [100%][0m | |
=================================== FAILURES =================================== | |
[31m[1m_______________________ TestBasicFunctions.test_my_mean ________________________[0m | |
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_mean> | |
[94mdef[39;49;00m [92mtest_my_mean[39;49;00m([96mself[39;49;00m): | |
test1 = [[94m5[39;49;00m, [94m7[39;49;00m, [94m2[39;49;00m, [94m2[39;49;00m, [94m7[39;49;00m, [94m9[39;49;00m, [94m30[39;49;00m, [94m20[39;49;00m, [94m2[39;49;00m, [94m6[39;49;00m, [94m44[39;49;00m, [94m44[39;49;00m, [94m4[39;49;00m, [94m4[39;49;00m, [94m225[39;49;00m] | |
> [96mself[39;49;00m.assertEqual(my_mean(test1), statistics.mean(test1)) | |
[1m[31mE AssertionError: None != 27.4[0m | |
[1m[31mtests/test_basic_functions.py[0m:11: AssertionError | |
[31m[1m______________________ TestBasicFunctions.test_my_median _______________________[0m | |
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_median> | |
[94mdef[39;49;00m [92mtest_my_median[39;49;00m([96mself[39;49;00m): | |
test1 = [[94m5[39;49;00m, [94m7[39;49;00m, [94m2[39;49;00m, [94m2[39;49;00m, [94m7[39;49;00m, [94m9[39;49;00m, [94m30[39;49;00m, [94m20[39;49;00m, [94m2[39;49;00m, [94m6[39;49;00m, [94m44[39;49;00m, [94m44[39;49;00m, [94m4[39;49;00m, [94m4[39;49;00m, [94m225[39;49;00m] | |
> [96mself[39;49;00m.assertEqual(my_median(test1), statistics.median(test1)) | |
[1m[31mE AssertionError: None != 7[0m | |
[1m[31mtests/test_basic_functions.py[0m:19: AssertionError | |
[31m[1m_______________________ TestBasicFunctions.test_my_mode ________________________[0m | |
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_mode> | |
[94mdef[39;49;00m [92mtest_my_mode[39;49;00m([96mself[39;49;00m): | |
test1 = [[94m5[39;49;00m, [94m7[39;49;00m, [94m2[39;49;00m, [94m2[39;49;00m, [94m7[39;49;00m, [94m9[39;49;00m, [94m30[39;49;00m, [94m20[39;49;00m, [94m2[39;49;00m, [94m6[39;49;00m, [94m44[39;49;00m, [94m44[39;49;00m, [94m4[39;49;00m, [94m4[39;49;00m, [94m225[39;49;00m] | |
> [96mself[39;49;00m.assertEqual(my_mode(test1), statistics.mode(test1)) | |
[1m[31mE AssertionError: None != 2[0m | |
[1m[31mtests/test_basic_functions.py[0m:27: AssertionError | |
[31m[1m________________ TestBasicFunctions.test_my_standard_deviation _________________[0m | |
self = <tests.test_basic_functions.TestBasicFunctions testMethod=test_my_standard_deviation> | |
[94mdef[39;49;00m [92mtest_my_standard_deviation[39;49;00m([96mself[39;49;00m): | |
test1 = [[94m5[39;49;00m, [94m7[39;49;00m, [94m2[39;49;00m, [94m2[39;49;00m, [94m7[39;49;00m, [94m9[39;49;00m, [94m30[39;49;00m, [94m20[39;49;00m, [94m2[39;49;00m, [94m6[39;49;00m, [94m44[39;49;00m, [94m44[39;49;00m, [94m4[39;49;00m, [94m4[39;49;00m, [94m225[39;49;00m] | |
> [96mself[39;49;00m.assertEqual(my_standard_deviation(test1), statistics.stdev(test1)) | |
[1m[31mE AssertionError: None != 56.58091551044397[0m | |
[1m[31mtests/test_basic_functions.py[0m:15: AssertionError | |
=========================== short test summary info ============================ | |
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_mean - Asse... | |
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_median - As... | |
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_mode - Asse... | |
FAILED tests/test_basic_functions.py::TestBasicFunctions::test_my_standard_deviation | |
[31m============================== [31m[1m4 failed[0m[31m in 0.16s[0m[31m ===============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/03-Central-Limit-Theorem | |
[1mcollecting ... [0mcollected 12 items | |
tests/test_distribution.py::TestDistribution::test_mean_is_a_float [32mPASSED[0m[32m [ 8%][0m | |
tests/test_distribution.py::TestDistribution::test_mean_value [32mPASSED[0m[32m [ 16%][0m | |
tests/test_distribution.py::TestDistribution::test_skewness_is_right [32mPASSED[0m[32m [ 25%][0m | |
tests/test_distribution.py::TestDistribution::test_standard_deviation_is_a_float [32mPASSED[0m[32m [ 33%][0m | |
tests/test_distribution.py::TestDistribution::test_standard_deviation_value [32mPASSED[0m[32m [ 41%][0m | |
tests/test_probability.py::TestProbability::test_mu_expected_is_mu [32mPASSED[0m[32m [ 50%][0m | |
tests/test_probability.py::TestProbability::test_probability_is_valid [32mPASSED[0m[32m [ 58%][0m | |
tests/test_probability.py::TestProbability::test_probability_is_very_low [32mPASSED[0m[32m [ 66%][0m | |
tests/test_probability.py::TestProbability::test_sigma_expected_value [32mPASSED[0m[32m [ 75%][0m | |
tests/test_zscore.py::TestZscore::test_probability_is_valid [32mPASSED[0m[32m [ 83%][0m | |
tests/test_zscore.py::TestZscore::test_probability_is_very_low [32mPASSED[0m[32m [ 91%][0m | |
tests/test_zscore.py::TestZscore::test_z_score_value [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m12 passed[0m[32m in 0.14s[0m[32m ==============================[0m | |
find . -iname "*.py" -not -path "./tests/*" | xargs pylint --output-format=colorized; true | |
[7;33m************* Module comparison[0m | |
comparison.py:6:0: C0301: [1mLine too long (116/100)[0m ([1mline-too-long[0m) | |
comparison.py:10:11: C0103: [1mVariable name "v" doesn't conform to snake_case naming style[0m ([1minvalid-name[0m) | |
comparison.py:10:11: W0612: [35mUnused variable 'v'[0m ([35munused-variable[0m) | |
[7;33m************* Module flip_coin_factorial[0m | |
flip_coin_factorial.py:21:0: C0305: [1mTrailing newlines[0m ([1mtrailing-newlines[0m) | |
flip_coin_factorial.py:8:4: W0101: [35mUnreachable code[0m ([35munreachable[0m) | |
flip_coin_factorial.py:8:4: W0107: [35mUnnecessary pass statement[0m ([35munnecessary-pass[0m) | |
[7;33m************* Module simulate_reality[0m | |
simulate_reality.py:9:8: W0612: [35mUnused variable 'i'[0m ([35munused-variable[0m) | |
------------------------------------------------------------------ | |
Your code has been rated at 8.16/10 (previous run: 8.16/10, +0.00) | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/03-Maths/02-Statistics-Probabilities/02-Toss-a-Coin | |
[1mcollecting ... [0mcollected 22 items | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_11 [32mPASSED[0m[32m [ 4%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_42 [32mPASSED[0m[32m [ 9%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_43 [32mPASSED[0m[32m [ 13%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_possibilities_44 [32mPASSED[0m[32m [ 18%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_1 [32mPASSED[0m[32m [ 22%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_10 [32mPASSED[0m[32m [ 27%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_2 [32mPASSED[0m[32m [ 31%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_count_total_possibilities_6 [32mPASSED[0m[32m [ 36%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_probability_1 [32mPASSED[0m[32m [ 40%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_probability_100 [32mPASSED[0m[32m [ 45%][0m | |
tests/test_flip_coin_factorial.py::TestTheory::test_probability_4 [32mPASSED[0m[32m [ 50%][0m | |
tests/test_mse.py::TestMSE::test_mean_squared_error_100 [32mPASSED[0m[32m [ 54%][0m | |
tests/test_mse.py::TestMSE::test_mean_squared_error_1000 [32mPASSED[0m[32m [ 59%][0m | |
tests/test_mse.py::TestMSE::test_mean_squared_error_10000 [32mPASSED[0m[32m [ 63%][0m | |
tests/test_mse.py::TestMSE::test_mean_squared_error_3 [32mPASSED[0m[32m [ 68%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_n_game_1 [32mPASSED[0m[32m [ 72%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_n_game_100 [32mPASSED[0m[32m [ 77%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_n_game_1000 [32mPASSED[0m[32m [ 81%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_one_game_1 [32mPASSED[0m[32m [ 86%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_one_game_10 [32mPASSED[0m[32m [ 90%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_one_game_100 [32mPASSED[0m[32m [ 95%][0m | |
tests/test_simulate_reality.py::TestReality::test_play_one_game_1000 [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m22 passed[0m[32m in 1.26s[0m[32m ==============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/02-Solvers | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_new_data_prediction.py::TestNewDataPrediction::test_predicted_class [32mPASSED[0m[32m [ 33%][0m | |
tests/test_new_data_prediction.py::TestNewDataPrediction::test_predicted_proba [32mPASSED[0m[32m [ 66%][0m | |
tests/test_solvers.py::TestSolvers::test_fastest_solver [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.13s[0m[32m ===============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/03-Batch-Gradient-Descent | |
[1mcollecting ... [0mcollected 2 items | |
tests/test_descent.py::TestDescent::test_a [32mPASSED[0m[32m [ 50%][0m | |
tests/test_descent.py::TestDescent::test_b [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m2 passed[0m[32m in 0.12s[0m[32m ===============================[0m | |
PYTHONDONTWRITEBYTECODE=1 pytest -v --color=yes | |
[1m============================= test session starts ==============================[0m | |
platform darwin -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/local/opt/[email protected]/bin/python3.9 | |
cachedir: .pytest_cache | |
rootdir: /Users/andybarnov/code/lewagon/data-solutions/05-ML/04-Under-the-hood/01-Loss-Functions | |
[1mcollecting ... [0mcollected 3 items | |
tests/test_loss_functions.py::TestLossFunctions::test_max_error_order [32mPASSED[0m[32m [ 33%][0m | |
tests/test_loss_functions.py::TestLossFunctions::test_r2 [32mPASSED[0m[32m [ 66%][0m | |
tests/test_loss_functions.py::TestLossFunctions::test_r2_mae [32mPASSED[0m[32m [100%][0m | |
[32m============================== [32m[1m3 passed[0m[32m in 0.12s[0m[32m ===============================[0m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ux | |
for file in $(find . -type d -exec test -e '{}'/Makefile \; -print) | |
do | |
make -C "$file"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment