This is a very basic thing to understand. Tensile test is done on cylinders because only cylinders can be held under pure tension by applying a compressive load. You’ll see that a cylinder always breaks down the diametric plane and not from a horizontal plane or inclined plane. That will only happen if it was under pure tension.
If we take any other prismatic shape such as square cross section cylinder, the failure will be via compression and not tension. If we take other shapes, there may be an uneven distribution of stresses which will give a wrong impression of tensile strength.