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