Level 7 : Consider the following file structure and content. If `python -m unittest discover -s tests` is executed from the `my_project` directory, will `test_standalone_function` be discovered and executed by `unittest`?


# File: my_project/tests/sub_tests/test_feature.py
import unittest

def test_standalone_function():
    """This function is not part of a unittest.TestCase class."""
    pass

class FeatureTest(unittest.TestCase):
    def test_feature_method(self):
        """This method is part of a unittest.TestCase class."""
        pass

Author: Ramya | Tags: test-discovery | 1859+ Python FAQs | Share
comparison | type-conversion | boolean | assert | introduction-to-multiprocessing | invalid-list | keyword | choice | list-join | int | anchors-(^,-$) | center | string-methods | split | syntax-error | list-comprehension | conditional-statement | test-discovery | frozenset | command-line-parsing | boolean-masking | id-function | encoding | data-type | generators | object-attribute | precedence | slice | decimal | interpreter | precedence-and-associativity | python_version | statement | numeric | introduction-to-python | python-operators | data-type-conversions | string-formatting | dictionary | handling-missing-values-(fillna,-dropna) | exception | call | dictionary-methods | comprehension | error | built-in-function | string | pseudocode | for | pass | staticmethod | sets | compute | fabs-function | string-concatenation | dataframe-and-series-objects | regex | regular-expressions | sorted | print | error-handling | range | bitwise-operator | string-iteration | access-modifier | binary | application | higher-order-function | default-mutable-argument | string-method | sum() | condition | init | data-types | file-handling | complex-number | sorting | list-slicing | sys | round | while-loops | operator | floating-point-precision | thread | namedtuple | list-method | constructor | magic-method | boolean-and-non-boolean | threading | syntaxerror | list-mutation | built-in | inheritance | error-handling | package-management | generators-in-python | directory-operations | typeerror | slicing | reading-and-writing-files | control-statement | list-vs-tuple | touples | working-with-binary-files-(rb,-wb) | dictionary-comprehensions | match | operator-or | docstring | class-and-object | mathematics | conditional-statements | objects | __future__ | format | python-module | using-map()-for-transformations | class-decorators | mysql | identity-operator | memory | pickling--unpickling | single-inheritance | zip-function | math-copysign | functions | pandas | string-formatting | overflow | print-statement | zfill-function | using-lists-as-stacks | dicts | filter-function | virtual-environment | comment | nested-loop | postfix | formal-and-actual-parameter | recursion | type_conversion | min-function | thread-synchronization | multiple-inheritance | data-structures | operator-and | logical-operator | bitwise | file_handling | aggregating-data-with-functools.reduce() | classes | mapping-function | datatype | data-type | descriptors | sorting-and-ranking | map-function | encapsulation | exponentiation | using-assertions-(assertequal,-assertraises) | iterable | logical-operation | membership-operators-(in,-not-in) | indentation | global-variable | else | managing-directories-with-os-and-shutil | enumerate() | thread-safe-data-structures-(queue.queue) | joining-and-merging-dataframes | type-conversion | overriding-methods | pep | arithmetic-operation | expression | exception-handling | context-manager | loop | immutability | asyncio | lambda-function | installation | assignment-operator | matrix-list-comprehension | logical-operator | string-slicing | counter-function | input-function | design-principle | advanced-file-operations | __all__-attribute | module | data-structure | version-check | filter | method-overloading | zip | escape-operator | loop-control-statements | operations | while-and-for-loop | filtering-and-indexing | input | integers | built-in-function | list-comprehensions | control-flow | gil | library | introduction-to-threads | head-and-tail | strings | arbitrary-arguments-(*args,-**kwargs) | using-join()-and-is_alive()-methods | multithreading | oops | functional-programming | set-operation | copy | min-max-function | loop-control | class-and-inheritance | collections | list-methods-and-slicing | numpy | mathematical-function | working-with-file-paths | asyncio-module | scientific-notation | inherit | list-comprehension | yield | list-operation | math | indexing | assignment-operators | iterators | operator-overloading | round-function | key-value-pairs | formatting-with-strftime | iterator | function-argument | variable | reading-and-writing-large-files-efficiently | swapping | tuple-unpacking | regular-expression | functional-programming | parameter | destructor | unit-testing | lambda-functions | binary-operation | methods | generator | sum-function | attribute | heap-memory | append | polymorphism | rollback | matplotlib | version | function-and-scope | multiprocessing | identifier | tuple | opening-files-(open()) | syntax | operators | default-arguments | using-the-threading-module | defining-functions | debugging | function | python | global-keyword | memory-management | parsing-with-strptime | working-with-dates-and-times | built-in-modules | multiple-except-blocks | list-indexing | datetime.date,-datetime.time,-datetime.datetime | why-use-multiprocessing-over-threading?-(gil) | loops | software-design | else-statement | max-min | bitwise-operator | immutable-data-type | benefit | __init_subclass__ | oop | logical-operators | literal-characters-and-special-characters | working-with-temporary-files-using-tempfile | factorial-function | using-yield-in-functions | data-structures-in-python | class | exception-handling | while-else-loop | global-variable | identity-operator | file | join | python-syntax-and-structure | static-method | tuples | class-and-instance-variable | shallow-copy | integer | random | update | lambda | creating-custom-modules | lists | set | data_structure | with-statement | counter | indexing:-loc-vs-iloc | time-series-with-pandas | python-repl | odd-number | python-history | basic | lambdas | complex | async | operand | intering | import-method | arithmetic-expression | feature | return-statement | random-function | expand-tab | decorator | list | using-else-and-finally | string-manipulation | input-function | collection | array | using-os-and-pathlib-modules | conditional-statement | string-slicing | turtle | method | multiple-inheritance | global | string-method | deep-copy | recurssion | namespace | sys-module | def | python-django | writing:-write(),-writelines() | name-mangling | data-structure | identity-operators-(is,-is-not) | matrix | floats | while-loop | implementation | type-conversion-and-casting | list,-set,-and-dictionary-comprehensions | file-handling | reading:-read(),-readline(),-readlines() | goto-function | mutable | raise-statement | datetime | dictionaries | tuple-methods | creating-and-starting-threads | quantifiers-(*,-+,-?,-{}) | conversion | control-flow | booleans | syntax-error | walking-through-directories-using-os.walk() | virtual-environment | stack | raise | difference-between-threads-and-processes ...