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