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