Best Python code snippet using pytest-bdd_python
test_fexceptions.py
Source:test_fexceptions.py  
1import pytest2# Local Exceptions3from fexception.fexception import *4# Local tests5from nested import (nested_override,6                    nested_no_override,7                    nested_no_format,8                    nested_custom_exception,9                    nested_nested_custom_exception)10__author__ = 'IncognitoCoding'11__copyright__ = 'Copyright 2022, test_fexceptions'12__credits__ = ['IncognitoCoding']13__license__ = 'MIT'14__version__ = '0.0.3'15__maintainer__ = 'IncognitoCoding'16__status__ = 'Beta'17class MySampleException(Exception):18    __module__ = 'builtins'19    exception_message: str20    def __init__(self, exception_message: str) -> None:21        self.exception_message = exception_message22# ############################################################23# ######Section Test Part 1 (Successful Value Checking)#######24# ############################################################25#26# FGeneralError tests any specific backend calls.27# pytest-cov does not check some of the calls/checks because it does28# not look at some underlying info like traceback. These have been excluded.29#30#31def test_1_FKBaseException():32    """33    Tests formatting a FKBaseException exception.34    """35    with pytest.raises(Exception) as excinfo:36        exc_args = {37            'main_message': 'Problem with the construction project.',38            'expected_result': 'A door',39            'returned_result': 'A window',40            'suggested_resolution': 'Call contractor',41        }42        raise FKBaseException(message_args=exc_args)43    assert 'Problem with the construction project.' in str(excinfo.value)44    assert 'A door' in str(excinfo.value)45    assert 'A window' in str(excinfo.value)46    assert 'Call contractor' in str(excinfo.value)47    assert 'Exception: FKBaseException' in str(excinfo.value)48def test_1_1_FKBaseException():49    """50    Tests formatting a FKBaseException exception with adjusted traceback.51    """52    with pytest.raises(Exception) as excinfo:53        exc_args = {54            'main_message': 'Problem with the construction project.',55            'expected_result': 'A door',56            'returned_result': 'A window',57            'suggested_resolution': 'Call contractor',58        }59        raise FKBaseException(message_args=exc_args,60                              tb_limit=None,61                              tb_remove_name='test_1_1_FKBaseException')62    assert 'Module: python' in str(excinfo.value)63    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)64    assert 'Line: 183' in str(excinfo.value)65def test_1_FException():66    """67    Tests formatting a FException exception.68    """69    with pytest.raises(Exception) as excinfo:70        exc_args = {71            'main_message': 'Problem with the construction project.',72            'expected_result': 'A door',73            'returned_result': 'A window',74            'suggested_resolution': 'Call contractor',75        }76        raise FException(message_args=exc_args)77    assert 'Problem with the construction project.' in str(excinfo.value)78    assert 'A door' in str(excinfo.value)79    assert 'A window' in str(excinfo.value)80    assert 'Call contractor' in str(excinfo.value)81    assert 'Exception: FException' in str(excinfo.value)82def test_1_1_FException():83    """84    Tests formatting a FException exception with adjusted traceback.85    """86    with pytest.raises(Exception) as excinfo:87        exc_args = {88            'main_message': 'Problem with the construction project.',89            'expected_result': 'A door',90            'returned_result': 'A window',91            'suggested_resolution': 'Call contractor',92        }93        raise FException(message_args=exc_args,94                         tb_limit=None,95                         tb_remove_name='test_1_1_FException')96    assert 'Module: python' in str(excinfo.value)97    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)98    assert 'Line: 183' in str(excinfo.value)99def test_1_FArithmeticError():100    """101    Tests formatting a FArithmeticError exception.102    """103    with pytest.raises(Exception) as excinfo:104        exc_args = {105            'main_message': 'Problem with the construction project.',106            'expected_result': 'A door',107            'returned_result': 'A window',108            'suggested_resolution': 'Call contractor',109        }110        raise FArithmeticError(message_args=exc_args)111    assert 'Problem with the construction project.' in str(excinfo.value)112    assert 'A door' in str(excinfo.value)113    assert 'A window' in str(excinfo.value)114    assert 'Call contractor' in str(excinfo.value)115    assert 'Exception: FArithmeticError' in str(excinfo.value)116def test_1_1_FArithmeticError():117    """118    Tests formatting a FArithmeticError exception with adjusted traceback.119    """120    with pytest.raises(Exception) as excinfo:121        exc_args = {122            'main_message': 'Problem with the construction project.',123            'expected_result': 'A door',124            'returned_result': 'A window',125            'suggested_resolution': 'Call contractor',126        }127        raise FArithmeticError(message_args=exc_args,128                               tb_limit=None,129                               tb_remove_name='test_1_1_FArithmeticError')130    assert 'Module: python' in str(excinfo.value)131    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)132    assert 'Line: 183' in str(excinfo.value)133def test_1_FBufferError():134    """135    Tests formatting a FBufferError exception.136    """137    with pytest.raises(Exception) as excinfo:138        exc_args = {139            'main_message': 'Problem with the construction project.',140            'expected_result': 'A door',141            'returned_result': 'A window',142            'suggested_resolution': 'Call contractor',143        }144        raise FBufferError(message_args=exc_args)145    assert 'Problem with the construction project.' in str(excinfo.value)146    assert 'A door' in str(excinfo.value)147    assert 'A window' in str(excinfo.value)148    assert 'Call contractor' in str(excinfo.value)149    assert 'Exception: FBufferError' in str(excinfo.value)150def test_1_1_FBufferError():151    """152    Tests formatting a FBufferError exception with adjusted traceback.153    """154    with pytest.raises(Exception) as excinfo:155        exc_args = {156            'main_message': 'Problem with the construction project.',157            'expected_result': 'A door',158            'returned_result': 'A window',159            'suggested_resolution': 'Call contractor',160        }161        raise FBufferError(message_args=exc_args,162                           tb_limit=None,163                           tb_remove_name='test_1_1_FBufferError')164    assert 'Module: python' in str(excinfo.value)165    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)166    assert 'Line: 183' in str(excinfo.value)167def test_1_FLookupError():168    """169    Testing the a FLookupError exception.170    """171    with pytest.raises(Exception) as excinfo:172        exc_args = {173            'main_message': 'Problem with the construction project.',174            'expected_result': 'A door',175            'returned_result': 'A window',176            'suggested_resolution': 'Call contractor',177        }178        raise FLookupError(message_args=exc_args)179    assert 'Problem with the construction project.' in str(excinfo.value)180    assert 'A door' in str(excinfo.value)181    assert 'A window' in str(excinfo.value)182    assert 'Call contractor' in str(excinfo.value)183    assert 'Exception: FLookupError' in str(excinfo.value)184def test_1_1_FLookupError():185    """186    Testing the a FLookupError exception with adjusted traceback.187    """188    with pytest.raises(Exception) as excinfo:189        exc_args = {190            'main_message': 'Problem with the construction project.',191            'expected_result': 'A door',192            'returned_result': 'A window',193            'suggested_resolution': 'Call contractor',194        }195        raise FLookupError(message_args=exc_args,196                           tb_limit=None,197                           tb_remove_name='test_1_1_FLookupError')198    assert 'Module: python' in str(excinfo.value)199    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)200    assert 'Line: 183' in str(excinfo.value)201def test_1_FAssertionError():202    """203    Testing the a FAssertionError exception.204    """205    with pytest.raises(Exception) as excinfo:206        exc_args = {207            'main_message': 'Problem with the construction project.',208            'expected_result': 'A door',209            'returned_result': 'A window',210            'suggested_resolution': 'Call contractor',211        }212        raise FAssertionError(message_args=exc_args)213    assert 'Problem with the construction project.' in str(excinfo.value)214    assert 'A door' in str(excinfo.value)215    assert 'A window' in str(excinfo.value)216    assert 'Call contractor' in str(excinfo.value)217    assert 'Exception: FAssertionError' in str(excinfo.value)218def test_1_1_FAssertionError():219    """220    Testing the a FAssertionError exception with adjusted traceback.221    """222    with pytest.raises(Exception) as excinfo:223        exc_args = {224            'main_message': 'Problem with the construction project.',225            'expected_result': 'A door',226            'returned_result': 'A window',227            'suggested_resolution': 'Call contractor',228        }229        raise FAssertionError(message_args=exc_args,230                              tb_limit=None,231                              tb_remove_name='test_1_1_FAssertionError')232    assert 'Module: python' in str(excinfo.value)233    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)234    assert 'Line: 183' in str(excinfo.value)235def test_1_FAttributeError():236    """237    Tests formatting a FAttributeError exception.238    """239    with pytest.raises(Exception) as excinfo:240        exc_args = {241            'main_message': 'Problem with the construction project.',242            'expected_result': 'A door',243            'returned_result': 'A window',244            'suggested_resolution': 'Call contractor',245        }246        raise FAttributeError(message_args=exc_args)247    assert 'Problem with the construction project.' in str(excinfo.value)248    assert 'A door' in str(excinfo.value)249    assert 'A window' in str(excinfo.value)250    assert 'Call contractor' in str(excinfo.value)251    assert 'Exception: FAttributeError' in str(excinfo.value)252def test_1_1_FAttributeError():253    """254    Tests formatting a FAttributeError exception with adjusted traceback.255    """256    with pytest.raises(Exception) as excinfo:257        exc_args = {258            'main_message': 'Problem with the construction project.',259            'expected_result': 'A door',260            'returned_result': 'A window',261            'suggested_resolution': 'Call contractor',262        }263        raise FAttributeError(message_args=exc_args,264                              tb_limit=None,265                              tb_remove_name='test_1_1_FAttributeError')266    assert 'Module: python' in str(excinfo.value)267    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)268    assert 'Line: 183' in str(excinfo.value)269def test_1_FEOFError():270    """271    Tests formatting a FEOFError exception.272    """273    with pytest.raises(Exception) as excinfo:274        exc_args = {275            'main_message': 'Problem with the construction project.',276            'expected_result': 'A door',277            'returned_result': 'A window',278            'suggested_resolution': 'Call contractor',279        }280        raise FEOFError(message_args=exc_args)281    assert 'Problem with the construction project.' in str(excinfo.value)282    assert 'A door' in str(excinfo.value)283    assert 'A window' in str(excinfo.value)284    assert 'Call contractor' in str(excinfo.value)285    assert 'Exception: FEOFError' in str(excinfo.value)286def test_1_1_FEOFError():287    """288    Tests formatting a FEOFError exception with adjusted traceback.289    """290    with pytest.raises(Exception) as excinfo:291        exc_args = {292            'main_message': 'Problem with the construction project.',293            'expected_result': 'A door',294            'returned_result': 'A window',295            'suggested_resolution': 'Call contractor',296        }297        raise FEOFError(message_args=exc_args,298                        tb_limit=None,299                        tb_remove_name='test_1_1_FEOFError')300    assert 'Module: python' in str(excinfo.value)301    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)302    assert 'Line: 183' in str(excinfo.value)303def test_1_FFloatingPointError():304    """305    Tests formatting a FFloatingPointError exception.306    """307    with pytest.raises(Exception) as excinfo:308        exc_args = {309            'main_message': 'Problem with the construction project.',310            'expected_result': 'A door',311            'returned_result': 'A window',312            'suggested_resolution': 'Call contractor',313        }314        raise FFloatingPointError(message_args=exc_args)315    assert 'Problem with the construction project.' in str(excinfo.value)316    assert 'A door' in str(excinfo.value)317    assert 'A window' in str(excinfo.value)318    assert 'Call contractor' in str(excinfo.value)319    assert 'Exception: FFloatingPointError' in str(excinfo.value)320def test_1_1_FFloatingPointError():321    """322    Tests formatting a FFloatingPointError exception with adjusted traceback.323    """324    with pytest.raises(Exception) as excinfo:325        exc_args = {326            'main_message': 'Problem with the construction project.',327            'expected_result': 'A door',328            'returned_result': 'A window',329            'suggested_resolution': 'Call contractor',330        }331        raise FFloatingPointError(message_args=exc_args,332                                  tb_limit=None,333                                  tb_remove_name='test_1_1_FFloatingPointError')334    assert 'Module: python' in str(excinfo.value)335    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)336    assert 'Line: 183' in str(excinfo.value)337def test_1_FGeneratorExit():338    """339    Tests formatting a FGeneratorExit exception.340    """341    with pytest.raises(Exception) as excinfo:342        exc_args = {343            'main_message': 'Problem with the construction project.',344            'expected_result': 'A door',345            'returned_result': 'A window',346            'suggested_resolution': 'Call contractor',347        }348        raise FGeneratorExit(message_args=exc_args)349    assert 'Problem with the construction project.' in str(excinfo.value)350    assert 'A door' in str(excinfo.value)351    assert 'A window' in str(excinfo.value)352    assert 'Call contractor' in str(excinfo.value)353    assert 'Exception: FGeneratorExit' in str(excinfo.value)354def test_1_1_FGeneratorExit():355    """356    Tests formatting a FGeneratorExit exception with adjusted traceback.357    """358    with pytest.raises(Exception) as excinfo:359        exc_args = {360            'main_message': 'Problem with the construction project.',361            'expected_result': 'A door',362            'returned_result': 'A window',363            'suggested_resolution': 'Call contractor',364        }365        raise FGeneratorExit(message_args=exc_args,366                             tb_limit=None,367                             tb_remove_name='test_1_1_FGeneratorExit')368    assert 'Module: python' in str(excinfo.value)369    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)370    assert 'Line: 183' in str(excinfo.value)371def test_1_FImportError():372    """373    Tests formatting a FImportError exception.374    """375    with pytest.raises(Exception) as excinfo:376        exc_args = {377            'main_message': 'Problem with the construction project.',378            'expected_result': 'A door',379            'returned_result': 'A window',380            'suggested_resolution': 'Call contractor',381        }382        raise FImportError(message_args=exc_args)383    assert 'Problem with the construction project.' in str(excinfo.value)384    assert 'A door' in str(excinfo.value)385    assert 'A window' in str(excinfo.value)386    assert 'Call contractor' in str(excinfo.value)387    assert 'Exception: FImportError' in str(excinfo.value)388def test_1_1_FImportError():389    """390    Tests formatting a FImportError exception with adjusted traceback.391    """392    with pytest.raises(Exception) as excinfo:393        exc_args = {394            'main_message': 'Problem with the construction project.',395            'expected_result': 'A door',396            'returned_result': 'A window',397            'suggested_resolution': 'Call contractor',398        }399        raise FImportError(message_args=exc_args,400                           tb_limit=None,401                           tb_remove_name='test_1_1_FImportError')402    assert 'Module: python' in str(excinfo.value)403    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)404    assert 'Line: 183' in str(excinfo.value)405def test_1_FModuleNotFoundError():406    """407    Tests formatting a FModuleNotFoundError exception.408    """409    with pytest.raises(Exception) as excinfo:410        exc_args = {411            'main_message': 'Problem with the construction project.',412            'expected_result': 'A door',413            'returned_result': 'A window',414            'suggested_resolution': 'Call contractor',415        }416        raise FModuleNotFoundError(message_args=exc_args)417    assert 'Problem with the construction project.' in str(excinfo.value)418    assert 'A door' in str(excinfo.value)419    assert 'A window' in str(excinfo.value)420    assert 'Call contractor' in str(excinfo.value)421    assert 'Exception: FModuleNotFoundError' in str(excinfo.value)422def test_1_1_FModuleNotFoundError():423    """424    Tests formatting a FModuleNotFoundError exception with adjusted traceback.425    """426    with pytest.raises(Exception) as excinfo:427        exc_args = {428            'main_message': 'Problem with the construction project.',429            'expected_result': 'A door',430            'returned_result': 'A window',431            'suggested_resolution': 'Call contractor',432        }433        raise FModuleNotFoundError(message_args=exc_args,434                                   tb_limit=None,435                                   tb_remove_name='test_1_1_FModuleNotFoundError')436    assert 'Module: python' in str(excinfo.value)437    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)438    assert 'Line: 183' in str(excinfo.value)439def test_1_FIndexError():440    """441    Tests formatting a FIndexError exception.442    """443    with pytest.raises(Exception) as excinfo:444        exc_args = {445            'main_message': 'Problem with the construction project.',446            'expected_result': 'A door',447            'returned_result': 'A window',448            'suggested_resolution': 'Call contractor',449        }450        raise FIndexError(message_args=exc_args)451    assert 'Problem with the construction project.' in str(excinfo.value)452    assert 'A door' in str(excinfo.value)453    assert 'A window' in str(excinfo.value)454    assert 'Call contractor' in str(excinfo.value)455    assert 'Exception: FIndexError' in str(excinfo.value)456def test_1_1_FIndexError():457    """458    Tests formatting a FIndexError exception with adjusted traceback.459    """460    with pytest.raises(Exception) as excinfo:461        exc_args = {462            'main_message': 'Problem with the construction project.',463            'expected_result': 'A door',464            'returned_result': 'A window',465            'suggested_resolution': 'Call contractor',466        }467        raise FIndexError(message_args=exc_args,468                          tb_limit=None,469                          tb_remove_name='test_1_1_FIndexError')470    assert 'Module: python' in str(excinfo.value)471    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)472    assert 'Line: 183' in str(excinfo.value)473def test_1_FKeyError():474    """475    Tests formatting a FKeyError exception.476    """477    with pytest.raises(Exception) as excinfo:478        exc_args = {479            'main_message': 'Problem with the construction project.',480            'expected_result': 'A door',481            'returned_result': 'A window',482            'suggested_resolution': 'Call contractor',483        }484        raise FKeyError(message_args=exc_args)485    assert 'Problem with the construction project.' in str(excinfo.value)486    assert 'A door' in str(excinfo.value)487    assert 'A window' in str(excinfo.value)488    assert 'Call contractor' in str(excinfo.value)489    assert 'Exception: FKeyError' in str(excinfo.value)490def test_1_1_FKeyError():491    """492    Tests formatting a FKeyError exception with adjusted traceback.493    """494    with pytest.raises(Exception) as excinfo:495        exc_args = {496            'main_message': 'Problem with the construction project.',497            'expected_result': 'A door',498            'returned_result': 'A window',499            'suggested_resolution': 'Call contractor',500        }501        raise FKeyError(message_args=exc_args,502                        tb_limit=None,503                        tb_remove_name='test_1_1_FKeyError')504    assert 'Module: python' in str(excinfo.value)505    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)506    assert 'Line: 183' in str(excinfo.value)507def test_1_FKeyboardInterrupt():508    """509    Tests formatting a FKeyboardInterrupt exception.510    """511    with pytest.raises(Exception) as excinfo:512        exc_args = {513            'main_message': 'Problem with the construction project.',514            'expected_result': 'A door',515            'returned_result': 'A window',516            'suggested_resolution': 'Call contractor',517        }518        raise FKeyboardInterrupt(message_args=exc_args)519    assert 'Problem with the construction project.' in str(excinfo.value)520    assert 'A door' in str(excinfo.value)521    assert 'A window' in str(excinfo.value)522    assert 'Call contractor' in str(excinfo.value)523    assert 'Exception: FKeyboardInterrupt' in str(excinfo.value)524def test_1_1_FKeyboardInterrupt():525    """526    Tests formatting a FKeyboardInterrupt exception with adjusted traceback.527    """528    with pytest.raises(Exception) as excinfo:529        exc_args = {530            'main_message': 'Problem with the construction project.',531            'expected_result': 'A door',532            'returned_result': 'A window',533            'suggested_resolution': 'Call contractor',534        }535        raise FKeyboardInterrupt(message_args=exc_args,536                                 tb_limit=None,537                                 tb_remove_name='test_1_1_FKeyboardInterrupt')538    assert 'Module: python' in str(excinfo.value)539    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)540    assert 'Line: 183' in str(excinfo.value)541def test_1_FMemoryError():542    """543    Tests formatting a FMemoryError exception.544    """545    with pytest.raises(Exception) as excinfo:546        exc_args = {547            'main_message': 'Problem with the construction project.',548            'expected_result': 'A door',549            'returned_result': 'A window',550            'suggested_resolution': 'Call contractor',551        }552        raise FMemoryError(message_args=exc_args)553    assert 'Problem with the construction project.' in str(excinfo.value)554    assert 'A door' in str(excinfo.value)555    assert 'A window' in str(excinfo.value)556    assert 'Call contractor' in str(excinfo.value)557    assert 'Exception: FMemoryError' in str(excinfo.value)558def test_1_1_FMemoryError():559    """560    Tests formatting a FMemoryError exception with adjusted traceback.561    """562    with pytest.raises(Exception) as excinfo:563        exc_args = {564            'main_message': 'Problem with the construction project.',565            'expected_result': 'A door',566            'returned_result': 'A window',567            'suggested_resolution': 'Call contractor',568        }569        raise FMemoryError(message_args=exc_args,570                           tb_limit=None,571                           tb_remove_name='test_1_1_FMemoryError')572    assert 'Module: python' in str(excinfo.value)573    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)574    assert 'Line: 183' in str(excinfo.value)575def test_1_FNameError():576    """577    Tests formatting a FNameError exception.578    """579    with pytest.raises(Exception) as excinfo:580        exc_args = {581            'main_message': 'Problem with the construction project.',582            'expected_result': 'A door',583            'returned_result': 'A window',584            'suggested_resolution': 'Call contractor',585        }586        raise FNameError(message_args=exc_args)587    assert 'Problem with the construction project.' in str(excinfo.value)588    assert 'A door' in str(excinfo.value)589    assert 'A window' in str(excinfo.value)590    assert 'Call contractor' in str(excinfo.value)591    assert 'Exception: FNameError' in str(excinfo.value)592def test_1_1_FNameError():593    """594    Tests formatting a FNameError exception with adjusted traceback.595    """596    with pytest.raises(Exception) as excinfo:597        exc_args = {598            'main_message': 'Problem with the construction project.',599            'expected_result': 'A door',600            'returned_result': 'A window',601            'suggested_resolution': 'Call contractor',602        }603        raise FNameError(message_args=exc_args,604                         tb_limit=None,605                         tb_remove_name='test_1_1_FNameError')606    assert 'Module: python' in str(excinfo.value)607    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)608    assert 'Line: 183' in str(excinfo.value)609def test_1_FNotImplementedError():610    """611    Tests formatting a FNotImplementedError exception.612    """613    with pytest.raises(Exception) as excinfo:614        exc_args = {615            'main_message': 'Problem with the construction project.',616            'expected_result': 'A door',617            'returned_result': 'A window',618            'suggested_resolution': 'Call contractor',619        }620        raise FNotImplementedError(message_args=exc_args)621    assert 'Problem with the construction project.' in str(excinfo.value)622    assert 'A door' in str(excinfo.value)623    assert 'A window' in str(excinfo.value)624    assert 'Call contractor' in str(excinfo.value)625    assert 'Exception: FNotImplementedError' in str(excinfo.value)626def test_1_1_FNotImplementedError():627    """628    Tests formatting a FNotImplementedError exception with adjusted traceback.629    """630    with pytest.raises(Exception) as excinfo:631        exc_args = {632            'main_message': 'Problem with the construction project.',633            'expected_result': 'A door',634            'returned_result': 'A window',635            'suggested_resolution': 'Call contractor',636        }637        raise FNotImplementedError(message_args=exc_args,638                                   tb_limit=None,639                                   tb_remove_name='test_1_1_FNotImplementedError')640    assert 'Module: python' in str(excinfo.value)641    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)642    assert 'Line: 183' in str(excinfo.value)643def test_1_FOSError():644    """645    Tests formatting a FOSError exception.646    """647    with pytest.raises(Exception) as excinfo:648        exc_args = {649            'main_message': 'Problem with the construction project.',650            'expected_result': 'A door',651            'returned_result': 'A window',652            'suggested_resolution': 'Call contractor',653        }654        raise FOSError(message_args=exc_args)655    assert 'Problem with the construction project.' in str(excinfo.value)656    assert 'A door' in str(excinfo.value)657    assert 'A window' in str(excinfo.value)658    assert 'Call contractor' in str(excinfo.value)659    assert 'Exception: FOSError' in str(excinfo.value)660def test_1_1_FOSError():661    """662    Tests formatting a FOSError exception with adjusted traceback.663    """664    with pytest.raises(Exception) as excinfo:665        exc_args = {666            'main_message': 'Problem with the construction project.',667            'expected_result': 'A door',668            'returned_result': 'A window',669            'suggested_resolution': 'Call contractor',670        }671        raise FOSError(message_args=exc_args,672                       tb_limit=None,673                       tb_remove_name='test_1_1_FOSError')674    assert 'Module: python' in str(excinfo.value)675    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)676    assert 'Line: 183' in str(excinfo.value)677def test_1_FOverflowError():678    """679    Tests formatting a FOverflowError exception.680    """681    with pytest.raises(Exception) as excinfo:682        exc_args = {683            'main_message': 'Problem with the construction project.',684            'expected_result': 'A door',685            'returned_result': 'A window',686            'suggested_resolution': 'Call contractor',687        }688        raise FOverflowError(message_args=exc_args)689    assert 'Problem with the construction project.' in str(excinfo.value)690    assert 'A door' in str(excinfo.value)691    assert 'A window' in str(excinfo.value)692    assert 'Call contractor' in str(excinfo.value)693    assert 'Exception: FOverflowError' in str(excinfo.value)694def test_1_1_FOverflowError():695    """696    Tests formatting a FOverflowError exception with adjusted traceback.697    """698    with pytest.raises(Exception) as excinfo:699        exc_args = {700            'main_message': 'Problem with the construction project.',701            'expected_result': 'A door',702            'returned_result': 'A window',703            'suggested_resolution': 'Call contractor',704        }705        raise FOverflowError(message_args=exc_args,706                             tb_limit=None,707                             tb_remove_name='test_1_1_FOverflowError')708    assert 'Module: python' in str(excinfo.value)709    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)710    assert 'Line: 183' in str(excinfo.value)711def test_1_FRecursionError():712    """713    Tests formatting a FRecursionError exception.714    """715    with pytest.raises(Exception) as excinfo:716        exc_args = {717            'main_message': 'Problem with the construction project.',718            'expected_result': 'A door',719            'returned_result': 'A window',720            'suggested_resolution': 'Call contractor',721        }722        raise FRecursionError(message_args=exc_args)723    assert 'Problem with the construction project.' in str(excinfo.value)724    assert 'A door' in str(excinfo.value)725    assert 'A window' in str(excinfo.value)726    assert 'Call contractor' in str(excinfo.value)727    assert 'Exception: FRecursionError' in str(excinfo.value)728def test_1_1_FRecursionError():729    """730    Tests formatting a FRecursionError exception with adjusted traceback.731    """732    with pytest.raises(Exception) as excinfo:733        exc_args = {734            'main_message': 'Problem with the construction project.',735            'expected_result': 'A door',736            'returned_result': 'A window',737            'suggested_resolution': 'Call contractor',738        }739        raise FRecursionError(message_args=exc_args,740                              tb_limit=None,741                              tb_remove_name='test_1_1_FRecursionError')742    assert 'Module: python' in str(excinfo.value)743    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)744    assert 'Line: 183' in str(excinfo.value)745def test_1_FReferenceError():746    """747    Tests formatting a FReferenceError exception.748    """749    with pytest.raises(Exception) as excinfo:750        exc_args = {751            'main_message': 'Problem with the construction project.',752            'expected_result': 'A door',753            'returned_result': 'A window',754            'suggested_resolution': 'Call contractor',755        }756        raise FReferenceError(message_args=exc_args)757    assert 'Problem with the construction project.' in str(excinfo.value)758    assert 'A door' in str(excinfo.value)759    assert 'A window' in str(excinfo.value)760    assert 'Call contractor' in str(excinfo.value)761    assert 'Exception: FReferenceError' in str(excinfo.value)762def test_1_1_FReferenceError():763    """764    Tests formatting a FReferenceError exception with adjusted traceback.765    """766    with pytest.raises(Exception) as excinfo:767        exc_args = {768            'main_message': 'Problem with the construction project.',769            'expected_result': 'A door',770            'returned_result': 'A window',771            'suggested_resolution': 'Call contractor',772        }773        raise FReferenceError(message_args=exc_args,774                              tb_limit=None,775                              tb_remove_name='test_1_1_FReferenceError')776    assert 'Module: python' in str(excinfo.value)777    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)778    assert 'Line: 183' in str(excinfo.value)779def test_1_FRuntimeError():780    """781    Tests formatting a FRuntimeError exception.782    """783    with pytest.raises(Exception) as excinfo:784        exc_args = {785            'main_message': 'Problem with the construction project.',786            'expected_result': 'A door',787            'returned_result': 'A window',788            'suggested_resolution': 'Call contractor',789        }790        raise FRuntimeError(message_args=exc_args)791    assert 'Problem with the construction project.' in str(excinfo.value)792    assert 'A door' in str(excinfo.value)793    assert 'A window' in str(excinfo.value)794    assert 'Call contractor' in str(excinfo.value)795    assert 'Exception: FRuntimeError' in str(excinfo.value)796def test_1_1_FRuntimeError():797    """798    Tests formatting a FRuntimeError exception with adjusted traceback.799    """800    with pytest.raises(Exception) as excinfo:801        exc_args = {802            'main_message': 'Problem with the construction project.',803            'expected_result': 'A door',804            'returned_result': 'A window',805            'suggested_resolution': 'Call contractor',806        }807        raise FRuntimeError(message_args=exc_args,808                            tb_limit=None,809                            tb_remove_name='test_1_1_FRuntimeError')810    assert 'Module: python' in str(excinfo.value)811    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)812    assert 'Line: 183' in str(excinfo.value)813def test_1_FStopIteration():814    """815    Tests formatting a FStopIteration exception.816    """817    with pytest.raises(Exception) as excinfo:818        exc_args = {819            'main_message': 'Problem with the construction project.',820            'expected_result': 'A door',821            'returned_result': 'A window',822            'suggested_resolution': 'Call contractor',823        }824        raise FStopIteration(message_args=exc_args)825    assert 'Problem with the construction project.' in str(excinfo.value)826    assert 'A door' in str(excinfo.value)827    assert 'A window' in str(excinfo.value)828    assert 'Call contractor' in str(excinfo.value)829    assert 'Exception: FStopIteration' in str(excinfo.value)830def test_1_1_FStopIteration():831    """832    Tests formatting a FStopIteration exception with adjusted traceback.833    """834    with pytest.raises(Exception) as excinfo:835        exc_args = {836            'main_message': 'Problem with the construction project.',837            'expected_result': 'A door',838            'returned_result': 'A window',839            'suggested_resolution': 'Call contractor',840        }841        raise FStopIteration(message_args=exc_args,842                             tb_limit=None,843                             tb_remove_name='test_1_1_FStopIteration')844    assert 'Module: python' in str(excinfo.value)845    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)846    assert 'Line: 183' in str(excinfo.value)847def test_1_FStopAsyncIteration():848    """849    Tests formatting a FStopAsyncIteration exception.850    """851    with pytest.raises(Exception) as excinfo:852        exc_args = {853            'main_message': 'Problem with the construction project.',854            'expected_result': 'A door',855            'returned_result': 'A window',856            'suggested_resolution': 'Call contractor',857        }858        raise FStopAsyncIteration(message_args=exc_args)859    assert 'Problem with the construction project.' in str(excinfo.value)860    assert 'A door' in str(excinfo.value)861    assert 'A window' in str(excinfo.value)862    assert 'Call contractor' in str(excinfo.value)863    assert 'Exception: FStopAsyncIteration' in str(excinfo.value)864def test_1_1_FStopAsyncIteration():865    """866    Tests formatting a FStopAsyncIteration exception with adjusted traceback.867    """868    with pytest.raises(Exception) as excinfo:869        exc_args = {870            'main_message': 'Problem with the construction project.',871            'expected_result': 'A door',872            'returned_result': 'A window',873            'suggested_resolution': 'Call contractor',874        }875        raise FStopAsyncIteration(message_args=exc_args,876                                  tb_limit=None,877                                  tb_remove_name='test_1_1_FStopAsyncIteration')878    assert 'Module: python' in str(excinfo.value)879    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)880    assert 'Line: 183' in str(excinfo.value)881def test_1_FSyntaxError():882    """883    Tests formatting a FSyntaxError exception.884    """885    with pytest.raises(Exception) as excinfo:886        exc_args = {887            'main_message': 'Problem with the construction project.',888            'expected_result': 'A door',889            'returned_result': 'A window',890            'suggested_resolution': 'Call contractor',891        }892        raise FSyntaxError(message_args=exc_args)893    assert 'Problem with the construction project.' in str(excinfo.value)894    assert 'A door' in str(excinfo.value)895    assert 'A window' in str(excinfo.value)896    assert 'Call contractor' in str(excinfo.value)897    assert 'Exception: FSyntaxError' in str(excinfo.value)898def test_1_1_FSyntaxError():899    """900    Tests formatting a FSyntaxError exception with adjusted traceback.901    """902    with pytest.raises(Exception) as excinfo:903        exc_args = {904            'main_message': 'Problem with the construction project.',905            'expected_result': 'A door',906            'returned_result': 'A window',907            'suggested_resolution': 'Call contractor',908        }909        raise FSyntaxError(message_args=exc_args,910                           tb_limit=None,911                           tb_remove_name='test_1_1_FSyntaxError')912    assert 'Module: python' in str(excinfo.value)913    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)914    assert 'Line: 183' in str(excinfo.value)915def test_1_FIndentationError():916    """917    Tests formatting a FIndentationError exception.918    """919    with pytest.raises(Exception) as excinfo:920        exc_args = {921            'main_message': 'Problem with the construction project.',922            'expected_result': 'A door',923            'returned_result': 'A window',924            'suggested_resolution': 'Call contractor',925        }926        raise FIndentationError(message_args=exc_args)927    assert 'Problem with the construction project.' in str(excinfo.value)928    assert 'A door' in str(excinfo.value)929    assert 'A window' in str(excinfo.value)930    assert 'Call contractor' in str(excinfo.value)931    assert 'Exception: FIndentationError' in str(excinfo.value)932def test_1_1_FIndentationError():933    """934    Tests formatting a FIndentationError exception with adjusted traceback.935    """936    with pytest.raises(Exception) as excinfo:937        exc_args = {938            'main_message': 'Problem with the construction project.',939            'expected_result': 'A door',940            'returned_result': 'A window',941            'suggested_resolution': 'Call contractor',942        }943        raise FIndentationError(message_args=exc_args,944                                tb_limit=None,945                                tb_remove_name='test_1_1_FIndentationError')946    assert 'Module: python' in str(excinfo.value)947    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)948    assert 'Line: 183' in str(excinfo.value)949def test_1_FTabError():950    """951    Tests formatting a FTabError exception.952    """953    with pytest.raises(Exception) as excinfo:954        exc_args = {955            'main_message': 'Problem with the construction project.',956            'expected_result': 'A door',957            'returned_result': 'A window',958            'suggested_resolution': 'Call contractor',959        }960        raise FTabError(message_args=exc_args)961    assert 'Problem with the construction project.' in str(excinfo.value)962    assert 'A door' in str(excinfo.value)963    assert 'A window' in str(excinfo.value)964    assert 'Call contractor' in str(excinfo.value)965    assert 'Exception: FTabError' in str(excinfo.value)966def test_1_1_FTabError():967    """968    Tests formatting a FTabError exception with adjusted traceback.969    """970    with pytest.raises(Exception) as excinfo:971        exc_args = {972            'main_message': 'Problem with the construction project.',973            'expected_result': 'A door',974            'returned_result': 'A window',975            'suggested_resolution': 'Call contractor',976        }977        raise FTabError(message_args=exc_args,978                        tb_limit=None,979                        tb_remove_name='test_1_1_FTabError')980    assert 'Module: python' in str(excinfo.value)981    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)982    assert 'Line: 183' in str(excinfo.value)983def test_1_FSystemError():984    """985    Tests formatting a FSystemError exception.986    """987    with pytest.raises(Exception) as excinfo:988        exc_args = {989            'main_message': 'Problem with the construction project.',990            'expected_result': 'A door',991            'returned_result': 'A window',992            'suggested_resolution': 'Call contractor',993        }994        raise FSystemError(message_args=exc_args)995    assert 'Problem with the construction project.' in str(excinfo.value)996    assert 'A door' in str(excinfo.value)997    assert 'A window' in str(excinfo.value)998    assert 'Call contractor' in str(excinfo.value)999    assert 'Exception: FSystemError' in str(excinfo.value)1000def test_1_1_FSystemError():1001    """1002    Tests formatting a FSystemError exception with adjusted traceback.1003    """1004    with pytest.raises(Exception) as excinfo:1005        exc_args = {1006            'main_message': 'Problem with the construction project.',1007            'expected_result': 'A door',1008            'returned_result': 'A window',1009            'suggested_resolution': 'Call contractor',1010        }1011        raise FSystemError(message_args=exc_args,1012                           tb_limit=None,1013                           tb_remove_name='test_1_1_FSystemError')1014    assert 'Module: python' in str(excinfo.value)1015    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1016    assert 'Line: 183' in str(excinfo.value)1017def test_1_FSystemExit():1018    """1019    Tests formatting a FSystemExit exception.1020    """1021    with pytest.raises(Exception) as excinfo:1022        exc_args = {1023            'main_message': 'Problem with the construction project.',1024            'expected_result': 'A door',1025            'returned_result': 'A window',1026            'suggested_resolution': 'Call contractor',1027        }1028        raise FSystemExit(message_args=exc_args)1029    assert 'Problem with the construction project.' in str(excinfo.value)1030    assert 'A door' in str(excinfo.value)1031    assert 'A window' in str(excinfo.value)1032    assert 'Call contractor' in str(excinfo.value)1033    assert 'Exception: FSystemExit' in str(excinfo.value)1034def test_1_1_FSystemExit():1035    """1036    Tests formatting a FSystemExit exception with adjusted traceback.1037    """1038    with pytest.raises(Exception) as excinfo:1039        exc_args = {1040            'main_message': 'Problem with the construction project.',1041            'expected_result': 'A door',1042            'returned_result': 'A window',1043            'suggested_resolution': 'Call contractor',1044        }1045        raise FSystemExit(message_args=exc_args,1046                          tb_limit=None,1047                          tb_remove_name='test_1_1_FSystemExit')1048    assert 'Module: python' in str(excinfo.value)1049    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1050    assert 'Line: 183' in str(excinfo.value)1051def test_1_FTypeError():1052    """1053    Tests formatting a FTypeError exception.1054    """1055    with pytest.raises(Exception) as excinfo:1056        exc_args = {1057            'main_message': 'Problem with the construction project.',1058            'expected_result': 'A door',1059            'returned_result': 'A window',1060            'suggested_resolution': 'Call contractor',1061        }1062        raise FTypeError(message_args=exc_args)1063    assert 'Problem with the construction project.' in str(excinfo.value)1064    assert 'A door' in str(excinfo.value)1065    assert 'A window' in str(excinfo.value)1066    assert 'Call contractor' in str(excinfo.value)1067    assert 'Exception: FTypeError' in str(excinfo.value)1068def test_1_1_FTypeError():1069    """1070    Tests formatting a FTypeError exception with adjusted traceback.1071    """1072    with pytest.raises(Exception) as excinfo:1073        exc_args = {1074            'main_message': 'Problem with the construction project.',1075            'expected_result': 'A door',1076            'returned_result': 'A window',1077            'suggested_resolution': 'Call contractor',1078        }1079        raise FTypeError(message_args=exc_args,1080                         tb_limit=None,1081                         tb_remove_name='test_1_1_FTypeError')1082    assert 'Module: python' in str(excinfo.value)1083    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1084    assert 'Line: 183' in str(excinfo.value)1085def test_1_FUnboundLocalError():1086    """1087    Tests formatting a FUnboundLocalError exception.1088    """1089    with pytest.raises(Exception) as excinfo:1090        exc_args = {1091            'main_message': 'Problem with the construction project.',1092            'expected_result': 'A door',1093            'returned_result': 'A window',1094            'suggested_resolution': 'Call contractor',1095        }1096        raise FUnboundLocalError(message_args=exc_args)1097    assert 'Problem with the construction project.' in str(excinfo.value)1098    assert 'A door' in str(excinfo.value)1099    assert 'A window' in str(excinfo.value)1100    assert 'Call contractor' in str(excinfo.value)1101    assert 'Exception: FUnboundLocalError' in str(excinfo.value)1102def test_1_1_FUnboundLocalError():1103    """1104    Tests formatting a FUnboundLocalError exception with adjusted traceback.1105    """1106    with pytest.raises(Exception) as excinfo:1107        exc_args = {1108            'main_message': 'Problem with the construction project.',1109            'expected_result': 'A door',1110            'returned_result': 'A window',1111            'suggested_resolution': 'Call contractor',1112        }1113        raise FUnboundLocalError(message_args=exc_args,1114                                 tb_limit=None,1115                                 tb_remove_name='test_1_1_FUnboundLocalError')1116    assert 'Module: python' in str(excinfo.value)1117    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1118    assert 'Line: 183' in str(excinfo.value)1119def test_1_FUnicodeError():1120    """1121    Tests formatting a FUnicodeError exception.1122    """1123    with pytest.raises(Exception) as excinfo:1124        exc_args = {1125            'main_message': 'Problem with the construction project.',1126            'expected_result': 'A door',1127            'returned_result': 'A window',1128            'suggested_resolution': 'Call contractor',1129        }1130        raise FUnicodeError(message_args=exc_args)1131    assert 'Problem with the construction project.' in str(excinfo.value)1132    assert 'A door' in str(excinfo.value)1133    assert 'A window' in str(excinfo.value)1134    assert 'Call contractor' in str(excinfo.value)1135    assert 'Exception: FUnicodeError' in str(excinfo.value)1136def test_1_1_FUnicodeError():1137    """1138    Tests formatting a FUnicodeError exception with adjusted traceback.1139    """1140    with pytest.raises(Exception) as excinfo:1141        exc_args = {1142            'main_message': 'Problem with the construction project.',1143            'expected_result': 'A door',1144            'returned_result': 'A window',1145            'suggested_resolution': 'Call contractor',1146        }1147        raise FUnicodeError(message_args=exc_args,1148                            tb_limit=None,1149                            tb_remove_name='test_1_1_FUnicodeError')1150    assert 'Module: python' in str(excinfo.value)1151    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1152    assert 'Line: 183' in str(excinfo.value)1153def test_1_FUnicodeEncodeError():1154    """1155    Tests formatting a FUnicodeEncodeError exception.1156    """1157    with pytest.raises(Exception) as excinfo:1158        exc_args = {1159            'main_message': 'Problem with the construction project.',1160            'expected_result': 'A door',1161            'returned_result': 'A window',1162            'suggested_resolution': 'Call contractor',1163        }1164        raise FUnicodeEncodeError(message_args=exc_args)1165    assert 'Problem with the construction project.' in str(excinfo.value)1166    assert 'A door' in str(excinfo.value)1167    assert 'A window' in str(excinfo.value)1168    assert 'Call contractor' in str(excinfo.value)1169    assert 'Exception: FUnicodeEncodeError' in str(excinfo.value)1170def test_1_1_FUnicodeEncodeError():1171    """1172    Tests formatting a FUnicodeEncodeError exception with adjusted traceback.1173    """1174    with pytest.raises(Exception) as excinfo:1175        exc_args = {1176            'main_message': 'Problem with the construction project.',1177            'expected_result': 'A door',1178            'returned_result': 'A window',1179            'suggested_resolution': 'Call contractor',1180        }1181        raise FUnicodeEncodeError(message_args=exc_args,1182                                  tb_limit=None,1183                                  tb_remove_name='test_1_1_FUnicodeEncodeError')1184    assert 'Module: python' in str(excinfo.value)1185    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1186    assert 'Line: 183' in str(excinfo.value)1187def test_1_FUnicodeDecodeError():1188    """1189    Tests formatting a FUnicodeDecodeError exception.1190    """1191    with pytest.raises(Exception) as excinfo:1192        exc_args = {1193            'main_message': 'Problem with the construction project.',1194            'expected_result': 'A door',1195            'returned_result': 'A window',1196            'suggested_resolution': 'Call contractor',1197        }1198        raise FUnicodeDecodeError(message_args=exc_args)1199    assert 'Problem with the construction project.' in str(excinfo.value)1200    assert 'A door' in str(excinfo.value)1201    assert 'A window' in str(excinfo.value)1202    assert 'Call contractor' in str(excinfo.value)1203    assert 'Exception: FUnicodeDecodeError' in str(excinfo.value)1204def test_1_1_FUnicodeDecodeError():1205    """1206    Tests formatting a FUnicodeDecodeError exception with adjusted traceback.1207    """1208    with pytest.raises(Exception) as excinfo:1209        exc_args = {1210            'main_message': 'Problem with the construction project.',1211            'expected_result': 'A door',1212            'returned_result': 'A window',1213            'suggested_resolution': 'Call contractor',1214        }1215        raise FUnicodeDecodeError(message_args=exc_args,1216                                  tb_limit=None,1217                                  tb_remove_name='test_1_1_FUnicodeDecodeError')1218    assert 'Module: python' in str(excinfo.value)1219    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1220    assert 'Line: 183' in str(excinfo.value)1221def test_1_FUnicodeTranslateError():1222    """1223    Tests formatting a FUnicodeTranslateError exception.1224    """1225    with pytest.raises(Exception) as excinfo:1226        exc_args = {1227            'main_message': 'Problem with the construction project.',1228            'expected_result': 'A door',1229            'returned_result': 'A window',1230            'suggested_resolution': 'Call contractor',1231        }1232        raise FUnicodeTranslateError(message_args=exc_args)1233    assert 'Problem with the construction project.' in str(excinfo.value)1234    assert 'A door' in str(excinfo.value)1235    assert 'A window' in str(excinfo.value)1236    assert 'Call contractor' in str(excinfo.value)1237    assert 'Exception: FUnicodeTranslateError' in str(excinfo.value)1238def test_1_1_FUnicodeTranslateError():1239    """1240    Tests formatting a FUnicodeTranslateError exception with adjusted traceback.1241    """1242    with pytest.raises(Exception) as excinfo:1243        exc_args = {1244            'main_message': 'Problem with the construction project.',1245            'expected_result': 'A door',1246            'returned_result': 'A window',1247            'suggested_resolution': 'Call contractor',1248        }1249        raise FUnicodeTranslateError(message_args=exc_args,1250                                     tb_limit=None,1251                                     tb_remove_name='test_1_1_FUnicodeTranslateError')1252    assert 'Module: python' in str(excinfo.value)1253    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1254    assert 'Line: 183' in str(excinfo.value)1255def test_1_FValueError():1256    """1257    Tests formatting a FValueError exception.1258    """1259    with pytest.raises(Exception) as excinfo:1260        exc_args = {1261            'main_message': 'Problem with the construction project.',1262            'expected_result': 'A door',1263            'returned_result': 'A window',1264            'suggested_resolution': 'Call contractor',1265        }1266        raise FValueError(message_args=exc_args)1267    assert 'Problem with the construction project.' in str(excinfo.value)1268    assert 'A door' in str(excinfo.value)1269    assert 'A window' in str(excinfo.value)1270    assert 'Call contractor' in str(excinfo.value)1271    assert 'Exception: FValueError' in str(excinfo.value)1272def test_1_1_FValueError():1273    """1274    Tests formatting a FValueError exception with adjusted traceback.1275    """1276    with pytest.raises(Exception) as excinfo:1277        exc_args = {1278            'main_message': 'Problem with the construction project.',1279            'expected_result': 'A door',1280            'returned_result': 'A window',1281            'suggested_resolution': 'Call contractor',1282        }1283        raise FValueError(message_args=exc_args,1284                          tb_limit=None,1285                          tb_remove_name='test_1_1_FValueError')1286    assert 'Module: python' in str(excinfo.value)1287    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1288    assert 'Line: 183' in str(excinfo.value)1289def test_1_FZeroDivisionError():1290    """1291    Tests formatting a FZeroDivisionError exception.1292    """1293    with pytest.raises(Exception) as excinfo:1294        exc_args = {1295            'main_message': 'Problem with the construction project.',1296            'expected_result': 'A door',1297            'returned_result': 'A window',1298            'suggested_resolution': 'Call contractor',1299        }1300        raise FZeroDivisionError(message_args=exc_args)1301    assert 'Problem with the construction project.' in str(excinfo.value)1302    assert 'A door' in str(excinfo.value)1303    assert 'A window' in str(excinfo.value)1304    assert 'Call contractor' in str(excinfo.value)1305    assert 'Exception: FZeroDivisionError' in str(excinfo.value)1306def test_1_1_FZeroDivisionError():1307    """1308    Tests formatting a FZeroDivisionError exception with adjusted traceback.1309    """1310    with pytest.raises(Exception) as excinfo:1311        exc_args = {1312            'main_message': 'Problem with the construction project.',1313            'expected_result': 'A door',1314            'returned_result': 'A window',1315            'suggested_resolution': 'Call contractor',1316        }1317        raise FZeroDivisionError(message_args=exc_args,1318                                 tb_limit=None,1319                                 tb_remove_name='test_1_1_FZeroDivisionError')1320    assert 'Module: python' in str(excinfo.value)1321    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1322    assert 'Line: 183' in str(excinfo.value)1323def test_1_FEnvironmentError():1324    """1325    Tests formatting a FEnvironmentError exception.1326    """1327    with pytest.raises(Exception) as excinfo:1328        exc_args = {1329            'main_message': 'Problem with the construction project.',1330            'expected_result': 'A door',1331            'returned_result': 'A window',1332            'suggested_resolution': 'Call contractor',1333        }1334        raise FEnvironmentError(message_args=exc_args)1335    assert 'Problem with the construction project.' in str(excinfo.value)1336    assert 'A door' in str(excinfo.value)1337    assert 'A window' in str(excinfo.value)1338    assert 'Call contractor' in str(excinfo.value)1339    assert 'Exception: FEnvironmentError' in str(excinfo.value)1340def test_1_1_FEnvironmentError():1341    """1342    Tests formatting a FEnvironmentError exception with adjusted traceback.1343    """1344    with pytest.raises(Exception) as excinfo:1345        exc_args = {1346            'main_message': 'Problem with the construction project.',1347            'expected_result': 'A door',1348            'returned_result': 'A window',1349            'suggested_resolution': 'Call contractor',1350        }1351        raise FEnvironmentError(message_args=exc_args,1352                                tb_limit=None,1353                                tb_remove_name='test_1_1_FEnvironmentError')1354    assert 'Module: python' in str(excinfo.value)1355    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1356    assert 'Line: 183' in str(excinfo.value)1357def test_1_FIOError():1358    """1359    Tests formatting a FIOError exception.1360    """1361    with pytest.raises(Exception) as excinfo:1362        exc_args = {1363            'main_message': 'Problem with the construction project.',1364            'expected_result': 'A door',1365            'returned_result': 'A window',1366            'suggested_resolution': 'Call contractor',1367        }1368        raise FIOError(message_args=exc_args)1369    assert 'Problem with the construction project.' in str(excinfo.value)1370    assert 'A door' in str(excinfo.value)1371    assert 'A window' in str(excinfo.value)1372    assert 'Call contractor' in str(excinfo.value)1373    assert 'Exception: FIOError' in str(excinfo.value)1374def test_1_1_FIOError():1375    """1376    Tests formatting a FIOError exception with adjusted traceback.1377    """1378    with pytest.raises(Exception) as excinfo:1379        exc_args = {1380            'main_message': 'Problem with the construction project.',1381            'expected_result': 'A door',1382            'returned_result': 'A window',1383            'suggested_resolution': 'Call contractor',1384        }1385        raise FIOError(message_args=exc_args,1386                       tb_limit=None,1387                       tb_remove_name='test_1_1_FIOError')1388    assert 'Module: python' in str(excinfo.value)1389    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1390    assert 'Line: 183' in str(excinfo.value)1391def test_1_FWindowsError():1392    """1393    Tests formatting a FWindowsError exception.1394    """1395    with pytest.raises(Exception) as excinfo:1396        exc_args = {1397            'main_message': 'Problem with the construction project.',1398            'expected_result': 'A door',1399            'returned_result': 'A window',1400            'suggested_resolution': 'Call contractor',1401        }1402        raise FWindowsError(message_args=exc_args)1403    assert 'Problem with the construction project.' in str(excinfo.value)1404    assert 'A door' in str(excinfo.value)1405    assert 'A window' in str(excinfo.value)1406    assert 'Call contractor' in str(excinfo.value)1407    assert 'Exception: FWindowsError' in str(excinfo.value)1408def test_1_1_FWindowsError():1409    """1410    Tests formatting a FWindowsError exception with adjusted traceback.1411    """1412    with pytest.raises(Exception) as excinfo:1413        exc_args = {1414            'main_message': 'Problem with the construction project.',1415            'expected_result': 'A door',1416            'returned_result': 'A window',1417            'suggested_resolution': 'Call contractor',1418        }1419        raise FWindowsError(message_args=exc_args,1420                            tb_limit=None,1421                            tb_remove_name='test_1_1_FWindowsError')1422    assert 'Module: python' in str(excinfo.value)1423    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1424    assert 'Line: 183' in str(excinfo.value)1425def test_1_FBlockingIOError():1426    """1427    Tests formatting a FBlockingIOError exception.1428    """1429    with pytest.raises(Exception) as excinfo:1430        exc_args = {1431            'main_message': 'Problem with the construction project.',1432            'expected_result': 'A door',1433            'returned_result': 'A window',1434            'suggested_resolution': 'Call contractor',1435        }1436        raise FBlockingIOError(message_args=exc_args)1437    assert 'Problem with the construction project.' in str(excinfo.value)1438    assert 'A door' in str(excinfo.value)1439    assert 'A window' in str(excinfo.value)1440    assert 'Call contractor' in str(excinfo.value)1441    assert 'Exception: FBlockingIOError' in str(excinfo.value)1442def test_1_1_FBlockingIOError():1443    """1444    Tests formatting a FBlockingIOError exception with adjusted traceback.1445    """1446    with pytest.raises(Exception) as excinfo:1447        exc_args = {1448            'main_message': 'Problem with the construction project.',1449            'expected_result': 'A door',1450            'returned_result': 'A window',1451            'suggested_resolution': 'Call contractor',1452        }1453        raise FBlockingIOError(message_args=exc_args,1454                               tb_limit=None,1455                               tb_remove_name='test_1_1_FBlockingIOError')1456    assert 'Module: python' in str(excinfo.value)1457    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1458    assert 'Line: 183' in str(excinfo.value)1459def test_1_FChildProcessError():1460    """1461    Tests formatting a FChildProcessError exception.1462    """1463    with pytest.raises(Exception) as excinfo:1464        exc_args = {1465            'main_message': 'Problem with the construction project.',1466            'expected_result': 'A door',1467            'returned_result': 'A window',1468            'suggested_resolution': 'Call contractor',1469        }1470        raise FChildProcessError(message_args=exc_args)1471    assert 'Problem with the construction project.' in str(excinfo.value)1472    assert 'A door' in str(excinfo.value)1473    assert 'A window' in str(excinfo.value)1474    assert 'Call contractor' in str(excinfo.value)1475    assert 'Exception: FChildProcessError' in str(excinfo.value)1476def test_1_1_FChildProcessError():1477    """1478    Tests formatting a FChildProcessError exception with adjusted traceback.1479    """1480    with pytest.raises(Exception) as excinfo:1481        exc_args = {1482            'main_message': 'Problem with the construction project.',1483            'expected_result': 'A door',1484            'returned_result': 'A window',1485            'suggested_resolution': 'Call contractor',1486        }1487        raise FChildProcessError(message_args=exc_args,1488                                 tb_limit=None,1489                                 tb_remove_name='test_1_1_FChildProcessError')1490    assert 'Module: python' in str(excinfo.value)1491    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1492    assert 'Line: 183' in str(excinfo.value)1493def test_1_FConnectionError():1494    """1495    Tests formatting a FConnectionError exception.1496    """1497    with pytest.raises(Exception) as excinfo:1498        exc_args = {1499            'main_message': 'Problem with the construction project.',1500            'expected_result': 'A door',1501            'returned_result': 'A window',1502            'suggested_resolution': 'Call contractor',1503        }1504        raise FConnectionError(message_args=exc_args)1505    assert 'Problem with the construction project.' in str(excinfo.value)1506    assert 'A door' in str(excinfo.value)1507    assert 'A window' in str(excinfo.value)1508    assert 'Call contractor' in str(excinfo.value)1509    assert 'Exception: FConnectionError' in str(excinfo.value)1510def test_1_1_FConnectionError():1511    """1512    Tests formatting a FConnectionError exception with adjusted traceback.1513    """1514    with pytest.raises(Exception) as excinfo:1515        exc_args = {1516            'main_message': 'Problem with the construction project.',1517            'expected_result': 'A door',1518            'returned_result': 'A window',1519            'suggested_resolution': 'Call contractor',1520        }1521        raise FConnectionError(message_args=exc_args,1522                               tb_limit=None,1523                               tb_remove_name='test_1_1_FConnectionError')1524    assert 'Module: python' in str(excinfo.value)1525    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1526    assert 'Line: 183' in str(excinfo.value)1527def test_1_FBrokenPipeError():1528    """1529    Tests formatting a FBrokenPipeError exception.1530    """1531    with pytest.raises(Exception) as excinfo:1532        exc_args = {1533            'main_message': 'Problem with the construction project.',1534            'expected_result': 'A door',1535            'returned_result': 'A window',1536            'suggested_resolution': 'Call contractor',1537        }1538        raise FBrokenPipeError(message_args=exc_args)1539    assert 'Problem with the construction project.' in str(excinfo.value)1540    assert 'A door' in str(excinfo.value)1541    assert 'A window' in str(excinfo.value)1542    assert 'Call contractor' in str(excinfo.value)1543    assert 'Exception: FBrokenPipeError' in str(excinfo.value)1544def test_1_1_FBrokenPipeError():1545    """1546    Tests formatting a FBrokenPipeError exception with adjusted traceback.1547    """1548    with pytest.raises(Exception) as excinfo:1549        exc_args = {1550            'main_message': 'Problem with the construction project.',1551            'expected_result': 'A door',1552            'returned_result': 'A window',1553            'suggested_resolution': 'Call contractor',1554        }1555        raise FBrokenPipeError(message_args=exc_args,1556                               tb_limit=None,1557                               tb_remove_name='test_1_1_FBrokenPipeError')1558    assert 'Module: python' in str(excinfo.value)1559    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1560    assert 'Line: 183' in str(excinfo.value)1561def test_1_FConnectionAbortedError():1562    """1563    Tests formatting a FConnectionAbortedError exception.1564    """1565    with pytest.raises(Exception) as excinfo:1566        exc_args = {1567            'main_message': 'Problem with the construction project.',1568            'expected_result': 'A door',1569            'returned_result': 'A window',1570            'suggested_resolution': 'Call contractor',1571        }1572        raise FConnectionAbortedError(message_args=exc_args)1573    assert 'Problem with the construction project.' in str(excinfo.value)1574    assert 'A door' in str(excinfo.value)1575    assert 'A window' in str(excinfo.value)1576    assert 'Call contractor' in str(excinfo.value)1577    assert 'Exception: FConnectionAbortedError' in str(excinfo.value)1578def test_1_1_FConnectionAbortedError():1579    """1580    Tests formatting a FConnectionAbortedError exception with adjusted traceback.1581    """1582    with pytest.raises(Exception) as excinfo:1583        exc_args = {1584            'main_message': 'Problem with the construction project.',1585            'expected_result': 'A door',1586            'returned_result': 'A window',1587            'suggested_resolution': 'Call contractor',1588        }1589        raise FConnectionAbortedError(message_args=exc_args,1590                                      tb_limit=None,1591                                      tb_remove_name='test_1_1_FConnectionAbortedError')1592    assert 'Module: python' in str(excinfo.value)1593    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1594    assert 'Line: 183' in str(excinfo.value)1595def test_1_FConnectionRefusedError():1596    """1597    Tests formatting a FConnectionRefusedError exception.1598    """1599    with pytest.raises(Exception) as excinfo:1600        exc_args = {1601            'main_message': 'Problem with the construction project.',1602            'expected_result': 'A door',1603            'returned_result': 'A window',1604            'suggested_resolution': 'Call contractor',1605        }1606        raise FConnectionRefusedError(message_args=exc_args)1607    assert 'Problem with the construction project.' in str(excinfo.value)1608    assert 'A door' in str(excinfo.value)1609    assert 'A window' in str(excinfo.value)1610    assert 'Call contractor' in str(excinfo.value)1611    assert 'Exception: FConnectionRefusedError' in str(excinfo.value)1612def test_1_1_FConnectionRefusedError():1613    """1614    Tests formatting a FConnectionRefusedError exception with adjusted traceback.1615    """1616    with pytest.raises(Exception) as excinfo:1617        exc_args = {1618            'main_message': 'Problem with the construction project.',1619            'expected_result': 'A door',1620            'returned_result': 'A window',1621            'suggested_resolution': 'Call contractor',1622        }1623        raise FConnectionRefusedError(message_args=exc_args,1624                                      tb_limit=None,1625                                      tb_remove_name='test_1_1_FConnectionRefusedError')1626    assert 'Module: python' in str(excinfo.value)1627    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1628    assert 'Line: 183' in str(excinfo.value)1629def test_1_FConnectionResetError():1630    """1631    Tests formatting a FConnectionResetError exception.1632    """1633    with pytest.raises(Exception) as excinfo:1634        exc_args = {1635            'main_message': 'Problem with the construction project.',1636            'expected_result': 'A door',1637            'returned_result': 'A window',1638            'suggested_resolution': 'Call contractor',1639        }1640        raise FConnectionResetError(message_args=exc_args)1641    assert 'Problem with the construction project.' in str(excinfo.value)1642    assert 'A door' in str(excinfo.value)1643    assert 'A window' in str(excinfo.value)1644    assert 'Call contractor' in str(excinfo.value)1645    assert 'Exception: FConnectionResetError' in str(excinfo.value)1646def test_1_1_FConnectionResetError():1647    """1648    Tests formatting a FConnectionResetError exception with adjusted traceback.1649    """1650    with pytest.raises(Exception) as excinfo:1651        exc_args = {1652            'main_message': 'Problem with the construction project.',1653            'expected_result': 'A door',1654            'returned_result': 'A window',1655            'suggested_resolution': 'Call contractor',1656        }1657        raise FConnectionResetError(message_args=exc_args,1658                                    tb_limit=None,1659                                    tb_remove_name='test_1_1_FConnectionResetError')1660    assert 'Module: python' in str(excinfo.value)1661    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1662    assert 'Line: 183' in str(excinfo.value)1663def test_1_FFileExistsError():1664    """1665    Tests formatting a FFileExistsError exception.1666    """1667    with pytest.raises(Exception) as excinfo:1668        exc_args = {1669            'main_message': 'Problem with the construction project.',1670            'expected_result': 'A door',1671            'returned_result': 'A window',1672            'suggested_resolution': 'Call contractor',1673        }1674        raise FFileExistsError(message_args=exc_args)1675    assert 'Problem with the construction project.' in str(excinfo.value)1676    assert 'A door' in str(excinfo.value)1677    assert 'A window' in str(excinfo.value)1678    assert 'Call contractor' in str(excinfo.value)1679    assert 'Exception: FFileExistsError' in str(excinfo.value)1680def test_1_1_FFileExistsError():1681    """1682    Tests formatting a FFileExistsError exception with adjusted traceback.1683    """1684    with pytest.raises(Exception) as excinfo:1685        exc_args = {1686            'main_message': 'Problem with the construction project.',1687            'expected_result': 'A door',1688            'returned_result': 'A window',1689            'suggested_resolution': 'Call contractor',1690        }1691        raise FFileExistsError(message_args=exc_args,1692                               tb_limit=None,1693                               tb_remove_name='test_1_1_FFileExistsError')1694    assert 'Module: python' in str(excinfo.value)1695    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1696    assert 'Line: 183' in str(excinfo.value)1697def test_1_FFileNotFoundError():1698    """1699    Tests formatting a FFileNotFoundError exception.1700    """1701    with pytest.raises(Exception) as excinfo:1702        exc_args = {1703            'main_message': 'Problem with the construction project.',1704            'expected_result': 'A door',1705            'returned_result': 'A window',1706            'suggested_resolution': 'Call contractor',1707        }1708        raise FFileNotFoundError(message_args=exc_args)1709    assert 'Problem with the construction project.' in str(excinfo.value)1710    assert 'A door' in str(excinfo.value)1711    assert 'A window' in str(excinfo.value)1712    assert 'Call contractor' in str(excinfo.value)1713    assert 'Exception: FFileNotFoundError' in str(excinfo.value)1714def test_1_1_FFileNotFoundError():1715    """1716    Tests formatting a FFileNotFoundError exception with adjusted traceback.1717    """1718    with pytest.raises(Exception) as excinfo:1719        exc_args = {1720            'main_message': 'Problem with the construction project.',1721            'expected_result': 'A door',1722            'returned_result': 'A window',1723            'suggested_resolution': 'Call contractor',1724        }1725        raise FFileNotFoundError(message_args=exc_args,1726                                 tb_limit=None,1727                                 tb_remove_name='test_1_1_FFileNotFoundError')1728    assert 'Module: python' in str(excinfo.value)1729    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1730    assert 'Line: 183' in str(excinfo.value)1731def test_1_FInterruptedError():1732    """1733    Tests formatting a FInterruptedError exception.1734    """1735    with pytest.raises(Exception) as excinfo:1736        exc_args = {1737            'main_message': 'Problem with the construction project.',1738            'expected_result': 'A door',1739            'returned_result': 'A window',1740            'suggested_resolution': 'Call contractor',1741        }1742        raise FInterruptedError(message_args=exc_args)1743    assert 'Problem with the construction project.' in str(excinfo.value)1744    assert 'A door' in str(excinfo.value)1745    assert 'A window' in str(excinfo.value)1746    assert 'Call contractor' in str(excinfo.value)1747    assert 'Exception: FInterruptedError' in str(excinfo.value)1748def test_1_1_FInterruptedError():1749    """1750    Tests formatting a FInterruptedError exception with adjusted traceback.1751    """1752    with pytest.raises(Exception) as excinfo:1753        exc_args = {1754            'main_message': 'Problem with the construction project.',1755            'expected_result': 'A door',1756            'returned_result': 'A window',1757            'suggested_resolution': 'Call contractor',1758        }1759        raise FInterruptedError(message_args=exc_args,1760                                tb_limit=None,1761                                tb_remove_name='test_1_1_FInterruptedError')1762    assert 'Module: python' in str(excinfo.value)1763    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1764    assert 'Line: 183' in str(excinfo.value)1765def test_1_FIsADirectoryError():1766    """1767    Tests formatting a FIsADirectoryError exception.1768    """1769    with pytest.raises(Exception) as excinfo:1770        exc_args = {1771            'main_message': 'Problem with the construction project.',1772            'expected_result': 'A door',1773            'returned_result': 'A window',1774            'suggested_resolution': 'Call contractor',1775        }1776        raise FIsADirectoryError(message_args=exc_args)1777    assert 'Problem with the construction project.' in str(excinfo.value)1778    assert 'A door' in str(excinfo.value)1779    assert 'A window' in str(excinfo.value)1780    assert 'Call contractor' in str(excinfo.value)1781    assert 'Exception: FIsADirectoryError' in str(excinfo.value)1782def test_1_1_FIsADirectoryError():1783    """1784    Tests formatting a FIsADirectoryError exception with adjusted traceback.1785    """1786    with pytest.raises(Exception) as excinfo:1787        exc_args = {1788            'main_message': 'Problem with the construction project.',1789            'expected_result': 'A door',1790            'returned_result': 'A window',1791            'suggested_resolution': 'Call contractor',1792        }1793        raise FIsADirectoryError(message_args=exc_args,1794                                 tb_limit=None,1795                                 tb_remove_name='test_1_1_FIsADirectoryError')1796    assert 'Module: python' in str(excinfo.value)1797    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1798    assert 'Line: 183' in str(excinfo.value)1799def test_1_FNotADirectoryError():1800    """1801    Tests formatting a FNotADirectoryError exception.1802    """1803    with pytest.raises(Exception) as excinfo:1804        exc_args = {1805            'main_message': 'Problem with the construction project.',1806            'expected_result': 'A door',1807            'returned_result': 'A window',1808            'suggested_resolution': 'Call contractor',1809        }1810        raise FNotADirectoryError(message_args=exc_args)1811    assert 'Problem with the construction project.' in str(excinfo.value)1812    assert 'A door' in str(excinfo.value)1813    assert 'A window' in str(excinfo.value)1814    assert 'Call contractor' in str(excinfo.value)1815    assert 'Exception: FNotADirectoryError' in str(excinfo.value)1816def test_1_1_FNotADirectoryError():1817    """1818    Tests formatting a FNotADirectoryError exception with adjusted traceback.1819    """1820    with pytest.raises(Exception) as excinfo:1821        exc_args = {1822            'main_message': 'Problem with the construction project.',1823            'expected_result': 'A door',1824            'returned_result': 'A window',1825            'suggested_resolution': 'Call contractor',1826        }1827        raise FNotADirectoryError(message_args=exc_args,1828                                  tb_limit=None,1829                                  tb_remove_name='test_1_1_FNotADirectoryError')1830    assert 'Module: python' in str(excinfo.value)1831    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1832    assert 'Line: 183' in str(excinfo.value)1833def test_1_FPermissionError():1834    """1835    Tests formatting a FPermissionError exception.1836    """1837    with pytest.raises(Exception) as excinfo:1838        exc_args = {1839            'main_message': 'Problem with the construction project.',1840            'expected_result': 'A door',1841            'returned_result': 'A window',1842            'suggested_resolution': 'Call contractor',1843        }1844        raise FPermissionError(message_args=exc_args)1845    assert 'Problem with the construction project.' in str(excinfo.value)1846    assert 'A door' in str(excinfo.value)1847    assert 'A window' in str(excinfo.value)1848    assert 'Call contractor' in str(excinfo.value)1849    assert 'Exception: FPermissionError' in str(excinfo.value)1850def test_1_1_FPermissionError():1851    """1852    Tests formatting a FPermissionError exception with adjusted traceback.1853    """1854    with pytest.raises(Exception) as excinfo:1855        exc_args = {1856            'main_message': 'Problem with the construction project.',1857            'expected_result': 'A door',1858            'returned_result': 'A window',1859            'suggested_resolution': 'Call contractor',1860        }1861        raise FPermissionError(message_args=exc_args,1862                               tb_limit=None,1863                               tb_remove_name='test_1_1_FPermissionError')1864    assert 'Module: python' in str(excinfo.value)1865    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1866    assert 'Line: 183' in str(excinfo.value)1867def test_1_FProcessLookupError():1868    """1869    Tests formatting a FProcessLookupError exception.1870    """1871    with pytest.raises(Exception) as excinfo:1872        exc_args = {1873            'main_message': 'Problem with the construction project.',1874            'expected_result': 'A door',1875            'returned_result': 'A window',1876            'suggested_resolution': 'Call contractor',1877        }1878        raise FProcessLookupError(message_args=exc_args)1879    assert 'Problem with the construction project.' in str(excinfo.value)1880    assert 'A door' in str(excinfo.value)1881    assert 'A window' in str(excinfo.value)1882    assert 'Call contractor' in str(excinfo.value)1883    assert 'Exception: FProcessLookupError' in str(excinfo.value)1884def test_1_1_FProcessLookupError():1885    """1886    Tests formatting a FProcessLookupError exception with adjusted traceback.1887    """1888    with pytest.raises(Exception) as excinfo:1889        exc_args = {1890            'main_message': 'Problem with the construction project.',1891            'expected_result': 'A door',1892            'returned_result': 'A window',1893            'suggested_resolution': 'Call contractor',1894        }1895        raise FProcessLookupError(message_args=exc_args,1896                                  tb_limit=None,1897                                  tb_remove_name='test_1_1_FProcessLookupError')1898    assert 'Module: python' in str(excinfo.value)1899    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1900    assert 'Line: 183' in str(excinfo.value)1901def test_1_FTimeoutError():1902    """1903    Tests formatting a FTimeoutError exception.1904    """1905    with pytest.raises(Exception) as excinfo:1906        exc_args = {1907            'main_message': 'Problem with the construction project.',1908            'expected_result': 'A door',1909            'returned_result': 'A window',1910            'suggested_resolution': 'Call contractor',1911        }1912        raise FTimeoutError(message_args=exc_args)1913    assert 'Problem with the construction project.' in str(excinfo.value)1914    assert 'A door' in str(excinfo.value)1915    assert 'A window' in str(excinfo.value)1916    assert 'Call contractor' in str(excinfo.value)1917    assert 'Exception: FTimeoutError' in str(excinfo.value)1918def test_1_1_FTimeoutError():1919    """1920    Tests formatting a FTimeoutError exception with adjusted traceback.1921    """1922    with pytest.raises(Exception) as excinfo:1923        exc_args = {1924            'main_message': 'Problem with the construction project.',1925            'expected_result': 'A door',1926            'returned_result': 'A window',1927            'suggested_resolution': 'Call contractor',1928        }1929        raise FTimeoutError(message_args=exc_args,1930                            tb_limit=None,1931                            tb_remove_name='test_1_1_FTimeoutError')1932    assert 'Module: python' in str(excinfo.value)1933    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1934    assert 'Line: 183' in str(excinfo.value)1935def test_1_FWarning():1936    """1937    Tests formatting a FWarning exception.1938    """1939    with pytest.raises(Exception) as excinfo:1940        exc_args = {1941            'main_message': 'Problem with the construction project.',1942            'expected_result': 'A door',1943            'returned_result': 'A window',1944            'suggested_resolution': 'Call contractor',1945        }1946        raise FWarning(message_args=exc_args)1947    assert 'Problem with the construction project.' in str(excinfo.value)1948    assert 'A door' in str(excinfo.value)1949    assert 'A window' in str(excinfo.value)1950    assert 'Call contractor' in str(excinfo.value)1951    assert 'Exception: FWarning' in str(excinfo.value)1952def test_1_1_FWarning():1953    """1954    Tests formatting a FWarning exception with adjusted traceback.1955    """1956    with pytest.raises(Exception) as excinfo:1957        exc_args = {1958            'main_message': 'Problem with the construction project.',1959            'expected_result': 'A door',1960            'returned_result': 'A window',1961            'suggested_resolution': 'Call contractor',1962        }1963        raise FWarning(message_args=exc_args,1964                       tb_limit=None,1965                       tb_remove_name='test_1_1_FWarning')1966    assert 'Module: python' in str(excinfo.value)1967    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)1968    assert 'Line: 183' in str(excinfo.value)1969def test_1_FUserWarning():1970    """1971    Tests formatting a FUserWarning exception.1972    """1973    with pytest.raises(Exception) as excinfo:1974        exc_args = {1975            'main_message': 'Problem with the construction project.',1976            'expected_result': 'A door',1977            'returned_result': 'A window',1978            'suggested_resolution': 'Call contractor',1979        }1980        raise FUserWarning(message_args=exc_args)1981    assert 'Problem with the construction project.' in str(excinfo.value)1982    assert 'A door' in str(excinfo.value)1983    assert 'A window' in str(excinfo.value)1984    assert 'Call contractor' in str(excinfo.value)1985    assert 'Exception: FUserWarning' in str(excinfo.value)1986def test_1_1_FUserWarning():1987    """1988    Tests formatting a FUserWarning exception with adjusted traceback.1989    """1990    with pytest.raises(Exception) as excinfo:1991        exc_args = {1992            'main_message': 'Problem with the construction project.',1993            'expected_result': 'A door',1994            'returned_result': 'A window',1995            'suggested_resolution': 'Call contractor',1996        }1997        raise FUserWarning(message_args=exc_args,1998                           tb_limit=None,1999                           tb_remove_name='test_1_1_FUserWarning')2000    assert 'Module: python' in str(excinfo.value)2001    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2002    assert 'Line: 183' in str(excinfo.value)2003def test_1_FDeprecationWarning():2004    """2005    Tests formatting a FDeprecationWarning exception.2006    """2007    with pytest.raises(Exception) as excinfo:2008        exc_args = {2009            'main_message': 'Problem with the construction project.',2010            'expected_result': 'A door',2011            'returned_result': 'A window',2012            'suggested_resolution': 'Call contractor',2013        }2014        raise FDeprecationWarning(message_args=exc_args)2015    assert 'Problem with the construction project.' in str(excinfo.value)2016    assert 'A door' in str(excinfo.value)2017    assert 'A window' in str(excinfo.value)2018    assert 'Call contractor' in str(excinfo.value)2019    assert 'Exception: FDeprecationWarning' in str(excinfo.value)2020def test_1_1_FDeprecationWarning():2021    """2022    Tests formatting a FDeprecationWarning exception with adjusted traceback.2023    """2024    with pytest.raises(Exception) as excinfo:2025        exc_args = {2026            'main_message': 'Problem with the construction project.',2027            'expected_result': 'A door',2028            'returned_result': 'A window',2029            'suggested_resolution': 'Call contractor',2030        }2031        raise FDeprecationWarning(message_args=exc_args,2032                                  tb_limit=None,2033                                  tb_remove_name='test_1_1_FDeprecationWarning')2034    assert 'Module: python' in str(excinfo.value)2035    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2036    assert 'Line: 183' in str(excinfo.value)2037def test_1_FPendingDeprecationWarning():2038    """2039    Tests formatting a FPendingDeprecationWarning exception.2040    """2041    with pytest.raises(Exception) as excinfo:2042        exc_args = {2043            'main_message': 'Problem with the construction project.',2044            'expected_result': 'A door',2045            'returned_result': 'A window',2046            'suggested_resolution': 'Call contractor',2047        }2048        raise FPendingDeprecationWarning(message_args=exc_args)2049    assert 'Problem with the construction project.' in str(excinfo.value)2050    assert 'A door' in str(excinfo.value)2051    assert 'A window' in str(excinfo.value)2052    assert 'Call contractor' in str(excinfo.value)2053    assert 'Exception: FPendingDeprecationWarning' in str(excinfo.value)2054def test_1_1_FPendingDeprecationWarning():2055    """2056    Tests formatting a FPendingDeprecationWarning exception with adjusted traceback.2057    """2058    with pytest.raises(Exception) as excinfo:2059        exc_args = {2060            'main_message': 'Problem with the construction project.',2061            'expected_result': 'A door',2062            'returned_result': 'A window',2063            'suggested_resolution': 'Call contractor',2064        }2065        raise FPendingDeprecationWarning(message_args=exc_args,2066                                         tb_limit=None,2067                                         tb_remove_name='test_1_1_FPendingDeprecationWarning')2068    assert 'Module: python' in str(excinfo.value)2069    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2070    assert 'Line: 183' in str(excinfo.value)2071def test_1_FSyntaxWarning():2072    """2073    Tests formatting a FSyntaxWarning exception.2074    """2075    with pytest.raises(Exception) as excinfo:2076        exc_args = {2077            'main_message': 'Problem with the construction project.',2078            'expected_result': 'A door',2079            'returned_result': 'A window',2080            'suggested_resolution': 'Call contractor',2081        }2082        raise FSyntaxWarning(message_args=exc_args)2083    assert 'Problem with the construction project.' in str(excinfo.value)2084    assert 'A door' in str(excinfo.value)2085    assert 'A window' in str(excinfo.value)2086    assert 'Call contractor' in str(excinfo.value)2087    assert 'Exception: FSyntaxWarning' in str(excinfo.value)2088def test_1_1_FSyntaxWarning():2089    """2090    Tests formatting a FSyntaxWarning exception with adjusted traceback.2091    """2092    with pytest.raises(Exception) as excinfo:2093        exc_args = {2094            'main_message': 'Problem with the construction project.',2095            'expected_result': 'A door',2096            'returned_result': 'A window',2097            'suggested_resolution': 'Call contractor',2098        }2099        raise FSyntaxWarning(message_args=exc_args,2100                             tb_limit=None,2101                             tb_remove_name='test_1_1_FSyntaxWarning')2102    assert 'Module: python' in str(excinfo.value)2103    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2104    assert 'Line: 183' in str(excinfo.value)2105def test_1_FRuntimeWarning():2106    """2107    Tests formatting a FRuntimeWarning exception.2108    """2109    with pytest.raises(Exception) as excinfo:2110        exc_args = {2111            'main_message': 'Problem with the construction project.',2112            'expected_result': 'A door',2113            'returned_result': 'A window',2114            'suggested_resolution': 'Call contractor',2115        }2116        raise FRuntimeWarning(message_args=exc_args)2117    assert 'Problem with the construction project.' in str(excinfo.value)2118    assert 'A door' in str(excinfo.value)2119    assert 'A window' in str(excinfo.value)2120    assert 'Call contractor' in str(excinfo.value)2121    assert 'Exception: FRuntimeWarning' in str(excinfo.value)2122def test_1_1_FRuntimeWarning():2123    """2124    Tests formatting a FRuntimeWarning exception with adjusted traceback.2125    """2126    with pytest.raises(Exception) as excinfo:2127        exc_args = {2128            'main_message': 'Problem with the construction project.',2129            'expected_result': 'A door',2130            'returned_result': 'A window',2131            'suggested_resolution': 'Call contractor',2132        }2133        raise FRuntimeWarning(message_args=exc_args,2134                              tb_limit=None,2135                              tb_remove_name='test_1_1_FRuntimeWarning')2136    assert 'Module: python' in str(excinfo.value)2137    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2138    assert 'Line: 183' in str(excinfo.value)2139def test_1_FFutureWarning():2140    """2141    Tests formatting a FFutureWarning exception.2142    """2143    with pytest.raises(Exception) as excinfo:2144        exc_args = {2145            'main_message': 'Problem with the construction project.',2146            'expected_result': 'A door',2147            'returned_result': 'A window',2148            'suggested_resolution': 'Call contractor',2149        }2150        raise FFutureWarning(message_args=exc_args)2151    assert 'Problem with the construction project.' in str(excinfo.value)2152    assert 'A door' in str(excinfo.value)2153    assert 'A window' in str(excinfo.value)2154    assert 'Call contractor' in str(excinfo.value)2155    assert 'Exception: FFutureWarning' in str(excinfo.value)2156def test_1_1_FFutureWarning():2157    """2158    Tests formatting a FFutureWarning exception with adjusted traceback.2159    """2160    with pytest.raises(Exception) as excinfo:2161        exc_args = {2162            'main_message': 'Problem with the construction project.',2163            'expected_result': 'A door',2164            'returned_result': 'A window',2165            'suggested_resolution': 'Call contractor',2166        }2167        raise FFutureWarning(message_args=exc_args,2168                             tb_limit=None,2169                             tb_remove_name='test_1_1_FFutureWarning')2170    assert 'Module: python' in str(excinfo.value)2171    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2172    assert 'Line: 183' in str(excinfo.value)2173def test_1_FImportWarning():2174    """2175    Tests formatting a FImportWarning exception.2176    """2177    with pytest.raises(Exception) as excinfo:2178        exc_args = {2179            'main_message': 'Problem with the construction project.',2180            'expected_result': 'A door',2181            'returned_result': 'A window',2182            'suggested_resolution': 'Call contractor',2183        }2184        raise FImportWarning(message_args=exc_args)2185    assert 'Problem with the construction project.' in str(excinfo.value)2186    assert 'A door' in str(excinfo.value)2187    assert 'A window' in str(excinfo.value)2188    assert 'Call contractor' in str(excinfo.value)2189    assert 'Exception: FImportWarning' in str(excinfo.value)2190def test_1_1_FImportWarning():2191    """2192    Tests formatting a FImportWarning exception with adjusted traceback.2193    """2194    with pytest.raises(Exception) as excinfo:2195        exc_args = {2196            'main_message': 'Problem with the construction project.',2197            'expected_result': 'A door',2198            'returned_result': 'A window',2199            'suggested_resolution': 'Call contractor',2200        }2201        raise FImportWarning(message_args=exc_args,2202                             tb_limit=None,2203                             tb_remove_name='test_1_1_FImportWarning')2204    assert 'Module: python' in str(excinfo.value)2205    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2206    assert 'Line: 183' in str(excinfo.value)2207def test_1_FUnicodeWarning():2208    """2209    Tests formatting a FUnicodeWarning exception.2210    """2211    with pytest.raises(Exception) as excinfo:2212        exc_args = {2213            'main_message': 'Problem with the construction project.',2214            'expected_result': 'A door',2215            'returned_result': 'A window',2216            'suggested_resolution': 'Call contractor',2217        }2218        raise FUnicodeWarning(message_args=exc_args)2219    assert 'Problem with the construction project.' in str(excinfo.value)2220    assert 'A door' in str(excinfo.value)2221    assert 'A window' in str(excinfo.value)2222    assert 'Call contractor' in str(excinfo.value)2223    assert 'Exception: FUnicodeWarning' in str(excinfo.value)2224def test_1_1_FUnicodeWarning():2225    """2226    Tests formatting a FUnicodeWarning exception with adjusted traceback.2227    """2228    with pytest.raises(Exception) as excinfo:2229        exc_args = {2230            'main_message': 'Problem with the construction project.',2231            'expected_result': 'A door',2232            'returned_result': 'A window',2233            'suggested_resolution': 'Call contractor',2234        }2235        raise FUnicodeWarning(message_args=exc_args,2236                              tb_limit=None,2237                              tb_remove_name='test_1_1_FUnicodeWarning')2238    assert 'Module: python' in str(excinfo.value)2239    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2240    assert 'Line: 183' in str(excinfo.value)2241def test_1_FEncodingWarning():2242    """2243    Tests formatting a FEncodingWarning exception.2244    """2245    with pytest.raises(Exception) as excinfo:2246        exc_args = {2247            'main_message': 'Problem with the construction project.',2248            'expected_result': 'A door',2249            'returned_result': 'A window',2250            'suggested_resolution': 'Call contractor',2251        }2252        raise FEncodingWarning(message_args=exc_args)2253    assert 'Problem with the construction project.' in str(excinfo.value)2254    assert 'A door' in str(excinfo.value)2255    assert 'A window' in str(excinfo.value)2256    assert 'Call contractor' in str(excinfo.value)2257    assert 'Exception: FEncodingWarning' in str(excinfo.value)2258def test_1_1_FEncodingWarning():2259    """2260    Tests formatting a FEncodingWarning exception with adjusted traceback.2261    """2262    with pytest.raises(Exception) as excinfo:2263        exc_args = {2264            'main_message': 'Problem with the construction project.',2265            'expected_result': 'A door',2266            'returned_result': 'A window',2267            'suggested_resolution': 'Call contractor',2268        }2269        raise FEncodingWarning(message_args=exc_args,2270                               tb_limit=None,2271                               tb_remove_name='test_1_1_FEncodingWarning')2272    assert 'Module: python' in str(excinfo.value)2273    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2274    assert 'Line: 183' in str(excinfo.value)2275def test_1_FBytesWarning():2276    """2277    Tests formatting a FBytesWarning exception.2278    """2279    with pytest.raises(Exception) as excinfo:2280        exc_args = {2281            'main_message': 'Problem with the construction project.',2282            'expected_result': 'A door',2283            'returned_result': 'A window',2284            'suggested_resolution': 'Call contractor',2285        }2286        raise FBytesWarning(message_args=exc_args)2287    assert 'Problem with the construction project.' in str(excinfo.value)2288    assert 'A door' in str(excinfo.value)2289    assert 'A window' in str(excinfo.value)2290    assert 'Call contractor' in str(excinfo.value)2291    assert 'Exception: FBytesWarning' in str(excinfo.value)2292def test_1_1_FBytesWarning():2293    """2294    Tests formatting a FBytesWarning exception with adjusted traceback.2295    """2296    with pytest.raises(Exception) as excinfo:2297        exc_args = {2298            'main_message': 'Problem with the construction project.',2299            'expected_result': 'A door',2300            'returned_result': 'A window',2301            'suggested_resolution': 'Call contractor',2302        }2303        raise FBytesWarning(message_args=exc_args,2304                            tb_limit=None,2305                            tb_remove_name='test_1_1_FBytesWarning')2306    assert 'Module: python' in str(excinfo.value)2307    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2308    assert 'Line: 183' in str(excinfo.value)2309def test_1_FResourceWarning():2310    """2311    Tests formatting a FResourceWarning exception.2312    """2313    with pytest.raises(Exception) as excinfo:2314        exc_args = {2315            'main_message': 'Problem with the construction project.',2316            'expected_result': 'A door',2317            'returned_result': 'A window',2318            'suggested_resolution': 'Call contractor',2319        }2320        raise FResourceWarning(message_args=exc_args)2321    assert 'Problem with the construction project.' in str(excinfo.value)2322    assert 'A door' in str(excinfo.value)2323    assert 'A window' in str(excinfo.value)2324    assert 'Call contractor' in str(excinfo.value)2325    assert 'Exception: FResourceWarning' in str(excinfo.value)2326def test_1_1_FResourceWarning():2327    """2328    Tests formatting a FResourceWarning exception with adjusted traceback.2329    """2330    with pytest.raises(Exception) as excinfo:2331        exc_args = {2332            'main_message': 'Problem with the construction project.',2333            'expected_result': 'A door',2334            'returned_result': 'A window',2335            'suggested_resolution': 'Call contractor',2336        }2337        raise FResourceWarning(message_args=exc_args,2338                               tb_limit=None,2339                               tb_remove_name='test_1_1_FResourceWarning')2340    assert 'Module: python' in str(excinfo.value)2341    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2342    assert 'Line: 183' in str(excinfo.value)2343def test_1_FCustomException():2344    """2345    Tests formatting a FCustomException exception.2346    """2347    with pytest.raises(Exception) as excinfo:2348        exc_args = {2349            'main_message': 'Problem with the construction project.',2350            'custom_type': MySampleException,2351            'expected_result': 'A door',2352            'returned_result': 'A window',2353            'suggested_resolution': 'Call contractor',2354        }2355        raise FCustomException(message_args=exc_args)2356    assert 'Problem with the construction project.' in str(excinfo.value)2357    assert 'A door' in str(excinfo.value)2358    assert 'A window' in str(excinfo.value)2359    assert 'Call contractor' in str(excinfo.value)2360    assert 'Exception: MySampleException' in str(excinfo.value)2361def test_1_1_FCustomException():2362    """2363    Tests formatting a FCustomException exception with adjusted traceback.2364    """2365    with pytest.raises(Exception) as excinfo:2366        exc_args = {2367            'main_message': 'Problem with the construction project.',2368            'custom_type': MySampleException,2369            'expected_result': 'A door',2370            'returned_result': 'A window',2371            'suggested_resolution': 'Call contractor',2372        }2373        raise FCustomException(message_args=exc_args,2374                               tb_limit=None,2375                               tb_remove_name='test_1_1_FCustomException')2376    assert 'Module: python' in str(excinfo.value)2377    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2378    assert 'Line: 183' in str(excinfo.value)2379    assert 'Exception: MySampleException' in str(excinfo.value)2380def test_1_2_FCustomException():2381    """2382    Tests formatting a custom type exception.2383    """2384    with pytest.raises(Exception) as excinfo:2385        exc_args = {2386            'main_message': 'Problem with the construction project.',2387            'custom_type': MySampleException,2388            'expected_result': 'A door',2389            'returned_result': 'A window',2390            'suggested_resolution': 'Call contractor',2391        }2392        raise MySampleException(FCustomException(message_args=exc_args))2393    assert 'Problem with the construction project.' in str(excinfo.value)2394    assert 'A door' in str(excinfo.value)2395    assert 'A window' in str(excinfo.value)2396    assert 'Call contractor' in str(excinfo.value)2397    assert 'Exception: MySampleException' in str(excinfo.value)2398def test_1_3_FCustomException():2399    """2400    Tests formatting a custom type exception to print.2401    """2402    exc_args = {2403        'main_message': 'Problem with the construction project.',2404        'custom_type': MySampleException,2405        'expected_result': 'A door',2406        'returned_result': 'A window',2407        'suggested_resolution': 'Call contractor',2408    }2409    my_exc = MySampleException(FCustomException(message_args=exc_args))2410    assert 'Problem with the construction project.' in str(my_exc)2411    assert 'A door' in str(my_exc)2412    assert 'A window' in str(my_exc)2413    assert 'Call contractor' in str(my_exc)2414    assert 'Exception: MySampleException' in str(my_exc)2415def test_1_4_FCustomException():2416    """2417    Tests formatting a custom type exception to print.2418    """2419    exc_args = {2420        'main_message': 'Problem with the construction project.',2421        'custom_type': MySampleException,2422        'expected_result': 'A door',2423        'returned_result': 'A window',2424        'suggested_resolution': 'Call contractor',2425    }2426    my_exc = FCustomException(message_args=exc_args)2427    assert 'Problem with the construction project.' in str(my_exc)2428    assert 'A door' in str(my_exc)2429    assert 'A window' in str(my_exc)2430    assert 'Call contractor' in str(my_exc)2431    assert 'Exception: MySampleException' in str(my_exc)2432def test_1_FGeneralError():2433    """2434    Tests formatting a FGeneralError exception.2435    """2436    with pytest.raises(Exception) as excinfo:2437        exc_args = {2438            'main_message': 'Problem with the construction project.',2439            'expected_result': 'A door',2440            'returned_result': 'A window',2441            'suggested_resolution': 'Call contractor',2442        }2443        raise FGeneralError(message_args=exc_args)2444    assert 'Problem with the construction project.' in str(excinfo.value)2445    assert 'A door' in str(excinfo.value)2446    assert 'A window' in str(excinfo.value)2447    assert 'Call contractor' in str(excinfo.value)2448    assert 'Exception: FGeneralError' in str(excinfo.value)2449    assert 'Module: test_fexceptions' in str(excinfo.value)2450    assert 'Name: test_1_FGeneralError' in str(excinfo.value)2451def test_1_1_FGeneralError():2452    """2453    Tests formatting a FGeneralError exception with adjusted traceback.2454    """2455    with pytest.raises(Exception) as excinfo:2456        exc_args = {2457            'main_message': 'Problem with the construction project.',2458            'expected_result': 'A door',2459            'returned_result': 'A window',2460            'suggested_resolution': 'Call contractor',2461        }2462        raise FGeneralError(message_args=exc_args,2463                            tb_limit=None,2464                            tb_remove_name='test_1_1_FGeneralError')2465    assert 'Module: python' in str(excinfo.value)2466    assert 'Name: pytest_pyfunc_call' in str(excinfo.value)2467    assert 'Line: 183' in str(excinfo.value)2468def test_1_2_FGeneralError():2469    """2470    Tests formatting a FGeneralError exception with lists.2471    """2472    with pytest.raises(Exception) as excinfo:2473        exc_args = {2474            'main_message': 'Problem with the construction project.',2475            'expected_result': ['A door'],2476            'returned_result': ['A window'],2477            'suggested_resolution': ['Call contractor'],2478        }2479        raise FGeneralError(message_args=exc_args)2480    assert 'Problem with the construction project.' in str(excinfo.value)2481    assert 'A door' in str(excinfo.value)2482    assert 'A window' in str(excinfo.value)2483    assert 'Call contractor' in str(excinfo.value)2484    assert 'Exception: FGeneralError' in str(excinfo.value)2485    assert 'Module: test_fexceptions' in str(excinfo.value)2486    assert 'Name: test_1_2_FGeneralError' in str(excinfo.value)2487def test_1_3_FGeneralError():2488    """2489    Tests formatting a FGeneralError exception with no main message.2490    """2491    with pytest.raises(Exception) as excinfo:2492        exc_args = {2493            'expected_result': 'A door',2494            'returned_result': 'A window',2495            'suggested_resolution': 'Call contractor',2496        }2497        raise FGeneralError(message_args=exc_args)2498    assert 'A door' in str(excinfo.value)2499    assert 'A window' in str(excinfo.value)2500    assert 'Call contractor' in str(excinfo.value)2501    assert 'Exception: FGeneralError' in str(excinfo.value)2502    assert 'Module: test_fexceptions' in str(excinfo.value)2503    assert 'Name: test_1_3_FGeneralError' in str(excinfo.value)2504def test_1_nested_override():2505    """2506    Tests using the override by calling the nested.py sample.2507    The adjusted traceback print can not be tested on the nested traceback because pytest2508    prints the original traceback details. This tests to make sure the formatted message2509    has the correct override output.2510    """2511    try:2512        nested_override()2513    except Exception as exc:2514        assert 'Exception: FTypeError' in str(exc)2515        assert 'Module: test_fexceptions' in str(exc)2516        assert 'Name: test_1_nested_override' in str(exc)2517        # Checks that Trace Details returns.2518        try:2519            exc_args = {2520                'main_message': 'Problem with the construction project.',2521                'original_exception': exc2522            }2523            raise FTypeError(message_args=exc_args)2524        except Exception as exc1:2525            assert 'Problem with the construction project.' in str(exc1)2526            assert '- Name:' in str(exc1).split('\n')[-5]2527            assert '- Line:' in str(exc1).split('\n')[-4]2528        # Checks that Trace Details returns.2529        try:2530            exc_args = {2531                'main_message': 'Problem with the construction project.',2532                'original_exception': exc2533            }2534            raise FTypeError(exc_args, tb_limit=2)2535        except Exception as exc1:2536            assert 'Problem with the construction project.' in str(exc1)2537            assert '- Name:' in str(exc1).split('\n')[-5]2538            assert '- Line:' in str(exc1).split('\n')[-4]2539        # Checks that Trace Details does not return.2540        try:2541            exc_args = {2542                'main_message': 'Problem with the construction project.',2543                'original_exception': exc2544            }2545            raise FTypeError(exc_args, tb_limit=0)2546        except Exception as exc2:2547            assert 'Problem with the construction project.' in str(exc2)2548            assert '- Name:' not in str(exc2).split('\n')[-5]2549            assert '- Line:' not in str(exc2).split('\n')[-4]2550def test_1_1_nested_no_override():2551    """2552    Tests formatting an exception with no override.2553    """2554    with pytest.raises(Exception) as excinfo:2555        nested_no_override()2556    assert 'Exception: FTypeError' in str(excinfo.value)2557    assert 'Module: nested' in str(excinfo.value)2558    assert 'Name: nested_no_override' in str(excinfo.value)2559def test_1_1_nested_no_format():2560    """2561    Tests formatting a nested exception that is not formatted.2562    Tests for the nested format wording.2563    """2564    try:2565        nested_no_format()2566    except Exception as exc:2567        assert 'Sample no format with the nested module' in str(exc)2568        # Checks that Trace Details returns.2569        try:2570            exc_args = {2571                'main_message': 'Problem with the construction project.',2572                'original_exception': exc2573            }2574            raise FTypeError(message_args=exc_args)2575        except Exception as exc1:2576            assert 'Problem with the construction project.' in str(exc1)2577            assert 'Nested Exception:' in str(exc1)2578            assert 'Sample no format with the nested module' in str(exc1)2579def test_1_1_nested_custom_exception():2580    """2581    Tests formatting a nested custom exception with a custom exception.2582    Tests 1 layer of nesting.2583    """2584    try:2585        nested_custom_exception()2586    except Exception as exc:2587        assert 'Sample problem with the nested module.' in str(exc)2588        try:2589            exc_args = {2590                'main_message': 'More problems with the construction project discussed.',2591                'custom_type': MySampleException,2592                'original_exception': exc2593            }2594            raise MySampleException(FCustomException(message_args=exc_args))2595        except Exception as exc1:2596            assert 'More problems with the construction project discussed.' in str(exc1)2597            assert 'Nested Exception:' in str(exc1)2598            assert 'Name: nested_custom_exception' in str(exc1)2599def test_1_1_nested_nested_custom_exception():2600    """2601    Tests formatting a nested custom exception with a custom exception.2602    Tests 2 layer of nesting. When using more than one layer of nesting some trace details are removed.2603    """2604    try:2605        nested_nested_custom_exception()2606    except Exception as exc:2607        assert 'Sample problem with the nested module in nested module.' in str(exc)2608        try:2609            exc_args = {2610                'main_message': 'More and more problems with the construction project discussed.',2611                'custom_type': MySampleException,2612                'original_exception': exc2613            }2614            raise MySampleException(FCustomException(message_args=exc_args))2615        except Exception as exc1:2616            assert 'nested_nested_custom_exception' in str(exc1)2617# ############################################################2618# ######Section Test Part 2 (Error/Catch Value Checking)######2619# ############################################################2620# All exceptions use similar back end creation calls. Only 1 Exception class will be used2621# to trigger the exception testing.2622def test_2_FGeneralError():2623    """2624    Tests an invalid message input key.2625    """2626    with pytest.raises(Exception) as excinfo:2627        exc_args = {2628            'bad_key': 'Problem with the construction project.',2629        }2630        raise FGeneralError(message_args=exc_args)2631    assert 'does not match any expected match option key' in str(excinfo.value)2632def test_2_1_FGeneralError():2633    """2634    Tests no keys.2635    """2636    with pytest.raises(Exception) as excinfo:2637        exc_args = {2638        }2639        raise FGeneralError(message_args=exc_args)2640    assert 'No key(s) were sent.' in str(excinfo.value)2641def test_2_2_FGeneralError():2642    """2643    Tests sending a single line string.2644    """2645    with pytest.raises(Exception) as excinfo:2646        raise FGeneralError(message_args='Single Line Exception')2647    assert ('Dictionary format is the required input to format an exception message. '2648            'Single line messages should use the built-in Python exceptions') in str(excinfo.value)2649def test_2_3_FGeneralError():2650    """2651    Tests sending an invalid tb_limit type.2652    """2653    with pytest.raises(Exception) as excinfo:2654        exc_args = {2655            'main_message': 'Problem with the construction project.',2656            'expected_result': 'A door',2657            'returned_result': 'A window',2658            'suggested_resolution': 'Call contractor',2659        }2660        raise FGeneralError(message_args=exc_args, tb_limit={'invalid Type'})2661    assert 'int format is the required input to set the traceback limit option.' in str(excinfo.value)2662def test_2_4_FGeneralError():2663    """2664    Tests sending an invalid tb_remove_name type.2665    """2666    with pytest.raises(Exception) as excinfo:2667        exc_args = {2668            'main_message': 'Problem with the construction project.',2669            'expected_result': 'A door',2670            'returned_result': 'A window',2671            'suggested_resolution': 'Call contractor',2672        }2673        raise FGeneralError(message_args=exc_args, tb_limit=None, tb_remove_name={'invalid Type'})2674    assert """Invalid tb_remove_name type.""" in str(excinfo.value)2675    assert """<class 'str'>""" in str(excinfo.value)2676    assert """<class 'set'>""" in str(excinfo.value)2677def test_2_5_FGeneralError():2678    """2679    Tests sending an invalid tb_remove_name type.2680    """2681    with pytest.raises(Exception) as excinfo:2682        exc_args = {2683            'main_message': 'Problem with the construction project.',2684            'expected_result': 'A door',2685            'returned_result': 'A window',2686            'suggested_resolution': 'Call contractor',2687        }2688        raise FGeneralError(message_args=exc_args, tb_limit=None, tb_remove_name='invalid_func')2689    assert """The function or method name did not match any co_name in the inspect.currentframe().""" in str(excinfo.value)2690    assert """'invalid_func' matching co_name""" in str(excinfo.value)2691    assert """Module: python""" in str(excinfo.value)2692    assert """Name: pytest_pyfunc_call""" in str(excinfo.value)2693    assert """Line: 183""" in str(excinfo.value)2694def test_2_FCustomException():2695    """2696    Tests an incorrect custom type exception.2697    """2698    with pytest.raises(Exception) as excinfo:2699        exc_args = {2700            'main_message': 'This is my test error message.',2701            'custom_type': 'BAD VALUE ERROR',2702        }2703        raise MySampleException(FCustomException(message_args=exc_args))...profile.py
Source:profile.py  
...104            pstats.Stats(self.combined, stream=terminalreporter).strip_dirs().sort_stats('cumulative').print_stats(20)105        if self.svg_name:106            terminalreporter.write("SVG profile in {svg}.\n".format(svg=self.svg_name))107    @pytest.mark.tryfirst108    def pytest_pyfunc_call(self, __multicall__, pyfuncitem):109        """Hook into pytest_pyfunc_call; marked as a tryfirst hook so that we110        can call everyone else inside `cProfile.runctx`.111        """112        prof = os.path.join("prof", pyfuncitem.name + ".prof")113        cProfile.runctx("fn()", globals(), dict(fn=__multicall__.execute), filename=prof)114        self.profs.append(prof)115def pytest_addoption(parser):116    """pytest_addoption hook for profiling plugin"""117    group = parser.getgroup('Profiling')118    group.addoption("--profile", action="store_true",119                    help="generate profiling information")120    group.addoption("--profile-svg", action="store_true",121                    help="generate profiling graph (using gprof2dot and dot -Tsvg)")122def pytest_configure(config):...pytest_returnvalues.py
Source:pytest_returnvalues.py  
...22        if hasattr(report, 'retval'):23            msg = report.retval24        outcome.force_result((out, letter, msg))25    @pytest.hookimpl(tryfirst=True)26    def pytest_pyfunc_call(self, pyfuncitem):27        testfunction = pyfuncitem.obj28        # Taken from _pytest/python.py/pytest_pyfunc_call()29        # This bit uses some internal functions which seem to change without notice.30        # Need to replace it with proper mechanism when such functionality is available in pytest.31        # Could be done with raising a special exception and catching it here,32        # but it would be hard to import it from a test somewhere deep in the hierarchy.33        # Add it as a parameter value maybe?34        funcargs = pyfuncitem.funcargs35        testargs = {arg: funcargs[arg] for arg in pyfuncitem._fixtureinfo.argnames}36        res = testfunction(**testargs)37        pyfuncitem.retval = res38        return True # finished processing the callback39    @pytest.hookimpl(hookwrapper=True)40    def pytest_runtest_makereport(self, item, call):41        outcome = yield42        report = outcome.get_result()...test_caller.py
Source:test_caller.py  
1# pylint: disable=no-self-use,redefined-outer-name2from io import StringIO3import sys4import pytest5from mock import patch6from flashback.debugging import caller7@pytest.fixture8def output():9    return StringIO()10class TestCaller:11    def test_execution(self, output):12        caller_instance = caller(output=output)13        captured = output.getvalue()14        assert caller_instance.__name__ == "pytest_pyfunc_call"15        assert len(captured.splitlines()) == 1216    def test_execution_with_depth(self, output):17        caller_instance = caller(depth=30, output=output)18        captured = output.getvalue()19        assert caller_instance.__name__ == "main"20        # Prior to python 3.8, the lineno for multiline calls is wrong21        if sys.version_info >= (3, 8):22            assert len(captured.splitlines()) == 1423        else:24            assert len(captured.splitlines()) == 1225    def test_execution_with_context(self, output):26        caller_instance = caller(context=10, output=output)27        captured = output.getvalue()28        assert caller_instance.__name__ == "pytest_pyfunc_call"29        assert len(captured.splitlines()) == 2230    @patch("inspect.currentframe")31    def test_no_frame(self, mocked_currentframe, output):32        mocked_currentframe.side_effect = [None]33        caller_instance = caller(output=output)34        captured = output.getvalue()35        assert caller_instance is None36        assert len(captured.splitlines()) == 237        assert "No code context found" in captured38    @patch("inspect.findsource")39    def test_no_context(self, mocked_findsource, output):40        mocked_findsource.side_effect = OSError("could not get source code")41        caller_instance = caller(depth=3, output=output)  # depth=3 because we have a decorator42        captured = output.getvalue()43        assert caller_instance.__name__ == "pytest_pyfunc_call"44        assert len(captured.splitlines()) == 245    @patch("flashback.debugging.get_callable")46    def test_no_callable(self, mocked_get_callable, output):47        mocked_get_callable.side_effect = [None]48        caller_instance = caller(output=output)49        captured = output.getvalue()50        assert caller_instance is None...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
